rmesserle: DollarDom vs jQuery (v3)

Revision 3 of this benchmark created on


Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
</script>
<script>
  /*
   dollarDom jQuery Plugin v1.0
   Copyright 2011 Robert Messerle
   Site: http://dollardom.robertmesserle.com/
   */
  
  (function($) {
    $.dom = function(str, attr, obj) {
      var id, $ret = $(document.createElement(str));
      if (attr) $ret.attr(attr);
      if (obj) for (id in obj) if ($ret[id]) $ret[id](obj[id]);
      return $ret;
    };
  })(jQuery);
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
jQuery
$( '<div />', { text: 'howdy', 'class': 'holy_smokes', css: { color: 'red' }, click: function() { alert('hi'); } });
ready
dollarDom
$.dom( 'div', { 'class': 'holy_smokes' }, { css: { color: 'red' }, click: function() { alert('hi'); } });
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.