jsPerf.app is an online JavaScript performance benchmark test runner & jsperf.com mirror. It is a complete rewrite in homage to the once excellent jsperf.com now with hopefully a more modern & maintainable codebase.
jsperf.com URLs are mirrored at the same path, e.g:
https://jsperf.com/negative-modulo/2
Can be accessed at:
https://jsperf.app/negative-modulo/2
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script>
var a = $('<div/>').append(Array(100).join('<a></a>')).find('a');
(function($, undef) {
var fly = $([]),
ctx = fly.context,
push = Array.prototype.push;
$.fly = function(elem) {
elem || (elem = ctx);
if (elem.nodeType || elem.length === undef) {
fly[0] = fly.context = elem;
fly.length = 1;
} else {
if (elem instanceof $) {
return elem;
}
if (typeof elem == "string") {
throw "use jQuery()";
}
fly.context = ctx;
fly.length = 0;
push.apply(fly, elem);
}
return fly;
};
})(jQuery);
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
Iterate using jQuery object |
| ready |
Iterate using jQuery.fly() |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.