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 Typed array iteration (v36) Revision 36 of this benchmark created on February 28, 2014 Preparation HTML <canvas width ="512" height ="512" id ="canvas" style ="border: 1px dashed black;" >
</canvas >
<script >
var classic = new Array (256 );
var context = document .getElementById ("canvas" ).getContext ("2d" );
var imageData = context.getImageData (0 , 0 , 256 , 256 );
var canvas = imageData.data ;
if (typeof Uint 8Array !== 'undefined' ) {
var typed8 = new Uint 8Array (256 );
var typed16 = new Uint 16Array (256 );
var typed32 = new Uint 32Array (256 );
}
for (var i = 0 ; i < 256 ; ++i) {
var number = ~~ (Math .random () * 254 )
classic[i] = number;
canvas[i] = number;
if (typeof Uint 8Array !== 'undefined' ) {
typed8[i] = number;
typed16[i] = number;
typed32[i] = number;
}
}
context.putImageData (imageData, 0 , 0 );
</script >
Setup if (typeof Uint 8Array === 'undefined' ) {
throw "Error" ;
}
Test runner Ready to run.
Run Quick Run Testing in Test Ops/sec Classic for (var ii = 0 ; ii < 256 ; ++ii) {
classic[ii] += 1 ;
}
ready
Canvas for (var ii = 0 ; ii < 256 ; ++ii) {
canvas[ii] += 1 ;
}
ready
Typed 8 for (var ii = 0 ; ii < 256 ; ++ii) {
typed8[ii] += 1 ;
}
ready
Typed 16 for (var ii = 0 ; ii < 256 ; ++ii) {
typed16[ii] += 1 ;
}
ready
Typed 32 for (var ii = 0 ; ii < 256 ; ++ii) {
typed32[ii] += 1 ;
}
ready
Revisions You can edit these tests or add more tests to this page by appending /edit to the URL.
Revision 1 : published by Bruno Garcia on November 23, 2010 Revision 2 : published by vjeux on December 2, 2010 Revision 3 : published by vjeux on December 2, 2010 Revision 4 : published by vjeux on December 15, 2010 Revision 6 : published by vjeux on December 15, 2010 Revision 9 : published by vjeux on December 15, 2010 Revision 10 : published by vjeux on December 15, 2010 Revision 11 : published by vjeux on December 15, 2010 Revision 13 : published by vjeux on December 15, 2010 Revision 22 : published on August 28, 2011 Revision 23 : published on January 13, 2012 Revision 25 : published on April 24, 2012 Revision 26 : published on July 12, 2012 Revision 27 : published on July 17, 2012 Revision 28 : published on August 2, 2012 Revision 29 : published on January 21, 2013 Revision 31 : published by Bart on June 15, 2013 Revision 32 : published on February 1, 2014 Revision 33 : published on February 1, 2014 Revision 34 : published on February 7, 2014 Revision 35 : published by Jerry Vigil on February 11, 2014 Revision 36 : published on February 28, 2014 Revision 37 : published on February 28, 2014 Revision 38 : published on February 28, 2014 Revision 39 : published by Yurgens on October 2, 2014 Revision 40 : published on January 30, 2015