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
Different methods of concatenating two arrays with 500 numbers. The first test uses the simple concat method, which creates a new array; the rest operate on the existing array.
Switched the order around, to confirm that the variable in the setup code was actually being created locally to each test.
var mainArr = [];
for (var i=0;i<500;i++) {
mainArr.push(Math.random());
}
var arrToAppend = mainArr.slice(0);
Benchmark.prototype.setup = function() {
var combinedArr = mainArr.slice(0);
};
Ready to run.
Test | Ops/sec | |
---|---|---|
push existing |
| ready |
splice existing |
| ready |
unshift existing |
| ready |
concat new |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.