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="//underscorejs.org/underscore-min.js"></script>
<script src="//d3js.org/d3.v3.min.js" charset="utf-8"></script>
<script src="https://raw.github.com/lodash/lodash/2.4.1/dist/lodash.min.js"></script>
<script>
var lodash = _.noConflict();
</script>
var _ = window._;
var d3 = window.d3;
var lodash = window.lodash;
var $Math = window.$Math;
var Math = window.Math;
d3.__max = function( array , f ) {
var i = 0,
n = array.length,
a,
b;
if ( f ) {
a = f.call( array , array[ i ] , i );
while (++i < n) if ((b = f.call( array , array[ i ] , i )) != null && a < b) a = b;
} else {
a = array[ i ];
while (++i < n) if ((b = array[i] ) != null && a < b) a = b;
}
return a;
};
var arr = [], maxLimit = 1000000000;
for (var i = 0; i < 100000; i++) {
arr.push(Math.floor(Math.random() * maxLimit));
}
Ready to run.
Test | Ops/sec | |
---|---|---|
Math.max |
| ready |
Underscore.max |
| ready |
D3.max |
| ready |
Lo-Dash.max |
| ready |
D3.__max |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.