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 reading and writing to all kinds of typed arrays, and of course classic arrays too.
<script type="text/javascript" notsrc="https://raw.github.com/mozilla/pdf.js/master/web/compatibility.js" src="https://bitbucket.org/lindenlab/llsd/raw/7d2646cd3f9b4c806e73aebc4b32bd81e4047fdc/js/typedarray.js"></script>
<script type="text/javascript">
var size = 640 * 480;
var arr = new Array( size );
//for (var idx = 0; idx < size; idx++) arr[idx] = Math.floor( Math.random() * 256 );
var ui32 = new Uint32Array( size );
//for (var idx = 0; idx < size; idx++) ui32[idx] = Math.floor( Math.random() * 256 * 256 * 256 * 256 );
var ui16 = new Uint16Array( size );
//for (var idx = 0; idx < size; idx++) ui16[idx] = Math.floor( Math.random() * 256 * 256 );
var ui8 = new Uint8Array( size );
//for (var idx = 0; idx < size; idx++) ui8[idx] = Math.floor( Math.random() * 256 );
var i32 = new Int32Array( size );
//for (var idx = 0; idx < size; idx++) i32[idx] = Math.floor( Math.random() * 256 * 256 * 256 * 256 );
var i16 = new Int16Array( size );
//for (var idx = 0; idx < size; idx++) i16[idx] = Math.floor( Math.random() * 256 * 256 );
var i8 = new Int8Array( size );
//for (var idx = 0; idx < size; idx++) i8[idx] = Math.floor( Math.random() * 256 );
var f32 = new Float32Array( size );
//for (var idx = 0; idx < size; idx++) f32[idx] = Math.random();
// var f64 = new Float64Array( size );
// for (var idx = 0; idx < size; idx++) f64[idx] = Math.random();
</script>
var vui32 = Math.floor( Math.random() * 256 * 256 * 256 * 256 );
var vui16 = Math.floor( Math.random() * 256 * 256 );
var vui8 = Math.floor( Math.random() * 256 );
var vi32 = Math.floor( Math.random() * 256 * 256 * 256 * 256 );
var vi16 = Math.floor( Math.random() * 256 * 256 );
var vi8 = Math.floor( Math.random() * 256 );
var vf32 = Math.random();
var varr = Math.floor( Math.random() * 256 );
Ready to run.
Test | Ops/sec | |
---|---|---|
Uint32Array |
| ready |
Uint16Array |
| ready |
Uint8Array |
| ready |
Int32Array |
| ready |
Int16Array |
| ready |
Int8Array |
| ready |
Float32Array |
| ready |
Uint32Array (REPEAT) |
| ready |
Array |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.