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
Test if re assign variable with underscore union is faster than push values to variable.
<script src="//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.5.2/underscore-min.js"></script>
var x = [],
y = [],
i = 0;
for (i; i < 100; i++) {
x.push(_.random(0, 100));
y.push(_.random(50, 150));
}
console.log(x)
Ready to run.
Test | Ops/sec | |
---|---|---|
Union re assign variable with underscore |
| ready |
Push variable to existing var |
| ready |
Concat and re assign |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.