jquery plugin adapter
JavaScript performance comparison
Preparation code
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script>
Benchmark.prototype.setup = function() {
var count = 100;
for(var i = 0; i < count; i++) {
$('body').append('<div id="'+ i +'">'+ i +'</div>');
}
var $jQuery = function ($) {
var jQuery = function () {
return $.apply(null, arguments);
};
jQuery.fn = jQuery.prototype;
return jQuery;
};
function SimpleJquery() {
var jQuery = $jQuery($);
(function($){
$.fn.abc = function(){};
})(jQuery);
return jQuery;
}
(function($){
$.fn.abc = function(){};
})(jQuery);
};
</script>
Preparation code output
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
| Test | Ops/sec | |
|---|---|---|
jquery-plugin |
|
pending… |
jquery-plugin-adapter |
|
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:
- Revision 1: published by chx007
- Revision 2: published by chx007
- Revision 3: published by chx007
0 comments