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 Inline style vs CSS class (v19) Revision 19 of this benchmark created by Eric Wooley on March 31, 2015 Preparation HTML <style rel ='stylesheet' >
.foo {color: #FF0; background-color: #964 }
.bar {color: #F0F, background-color: #B2C}
</style >
Setup var foo = {color : '#FF0' , 'background-color' : '#964' };
var bar = {color : '#F0F' , 'background-color' : '#B2C' };
var node = document .createElement ('div' );
node.innerHTML = 'test Text' ;
document .body .appendChild (node);
Teardown
document .body .removeChild (node);
Test runner Ready to run.
Run Quick Run Testing in Test Ops/sec Inline style
node.style .color = foo.color ;
node.style ['background-color' ] = foo['background-color' ];
node.style .color = bar.color ;
node.style ['background-color' ] = bar['background-color' ];
ready
CSS class node.className = 'foo' ;
node.className = 'bar' ;
ready
inline style object node.style = foo;
node.style = bar;
ready
Revisions You can edit these tests or add more tests to this page by appending /edit to the URL.
Revision 1 : published on September 27, 2013 Revision 2 : published by Sergey Ermakovich on September 30, 2013 Revision 3 : published on February 13, 2014 Revision 4 : published on April 30, 2014 Revision 5 : published on April 30, 2014 Revision 6 : published on May 22, 2014 Revision 7 : published by macwoj on June 11, 2014 Revision 8 : published by Jonas Gebhardt on July 18, 2014 Revision 9 : published on November 5, 2014 Revision 10 : published by Mike McKenzie on November 13, 2014 Revision 11 : published on December 5, 2014 Revision 12 : published on December 5, 2014 Revision 14 : published by carl sverre on February 14, 2015 Revision 16 : published on March 10, 2015 Revision 18 : published by Eric Wooley on March 31, 2015 Revision 19 : published by Eric Wooley on March 31, 2015 Revision 20 : published by Alec on September 13, 2015 Revision 21 : published on November 20, 2015 Revision 22 : published by Sergey Mamyan on December 12, 2015 Revision 23 : published by Inline style vs CSS class (more styles) on January 15, 2016