jquery plugin adapter

JavaScript performance comparison

Revision 2 of this test case created by chx007

Preparation code

<script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
<script>
Benchmark.prototype.setup = function() {
    var count = 100;
    var htmlArr = [];
    for(var i = 0; i < count; i++) {
      htmlArr.push('<div id="'+ i +'">'+ i +'</div>');
    }
   
    $('body').append(htmlArr.join(''));
   
    function SimpleJquery() {
      var jQuery = $.sub();
     
      (function($){
        $.fn.abc = function(){};
      })(jQuery);
   
      return function(){return $.apply(null, arguments);}//jQuery;
    }
   
    var simpleJquery = SimpleJquery();
    (function($){
      $.fn.abc = function(){};
    })(jQuery);
};
</script>

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
jquery-plugin-adapter
for(var i = 0; i < count; i++) {
  simpleJquery('#'+i).abc();
}
pending…
jquery-plugin
for(var i = 0; i < count; i++) {
  $('#'+i).abc();
}
pending…

Compare results of other browsers

Revisions

You can edit these tests or add even more tests to this page by appending /edit to the URL. Here’s a list of current revisions for this page:

0 comments

Add a comment