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.
Removed setup function because 'combinedArr is not defined' error in IE8 made me suspicious of the variable scope of the setup function and the test function. Now each test function will define its own instance of 'combinedArr'.
<script>
var mainArr = [];
for (var i=0;i<500;i++) {
mainArr.push(Math.random());
}
var arrToAppend = mainArr.slice(0);
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
concat new |
| ready |
push existing |
| ready |
unshift existing |
| ready |
splice existing |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.