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
Obviously these tests are very useful as we know that Underscore.js defaults to Array.prototype.map
if the given list passes instanceof Array
test.
<script src="//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.5.2/underscore-min.js"></script>
var output, marr = []; /* output variable to prevent possible no-op optimizations by V8 */
for (var i = 0; i <= 30; i++) {
marr.push(~~(Math.random() * 256));
}
var double = function(n) {
return n * 2;
};
Ready to run.
Test | Ops/sec | |
---|---|---|
Underscore |
| ready |
Array.prototype.map |
| ready |
For loop with function call |
| ready |
For loop |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.