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/prototype/1.7/prototype.js">
</script>
Array.fy1 = function(o) {
for (var p = Array.prototype, m = ["pop", "push", "reverse", "shift", "sort", "splice", "unshift", "concat", "join", "slice", "indexOf", "lastIndexOf", "filter", "forEach", "every", "map", "some", "reduce", "reduceRight"], i = m.length; i--;) {
o[m[i]] = p[m[i]];
}
return o;
};
Array.fy2 = (function(p) {
var m = ["pop", "push", "reverse", "shift", "sort", "splice", "unshift", "concat", "join", "slice", "indexOf", "lastIndexOf", "filter", "forEach", "every", "map", "some", "reduce", "reduceRight"],
len = m.length;
return function(o) {
for (var i = len; i--;) {
o[m[i]] = p[m[i]];
}
return o;
};
})(Array.prototype);
Benchmark.prototype.setup = function() {
var args = (function() {
return arguments;
})(1, 2, 3, 'a', 'b', 'c');
};
Ready to run.
Test | Ops/sec | |
---|---|---|
local var |
| ready |
closure var |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.