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 style versus jquery css (v7) Revision 7 of this benchmark created by Marcin on July 8, 2012 Preparation HTML <div id ="test" style ="width: 400px; height: 200px; background-color: #ccc;" >
</div >
<script src ="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js" >
</script >
Setup function css (elements, obj ) {
for (var e = 0 , elen = elements.length ; e < elen; e++) {
for (var i in obj) {
elements[e].style [i] = obj[i]
}
}
}
function css2 (elements, obj ) {
var style = elements.style ;
if (!style) {
for (var e = 0 , elen = elements.length ; e < elen; e++) {
css2 (elements[e], obj)
}
} else {
for (var i in obj) {
style[i] = obj[i]
}
}
}
Test runner Ready to run.
Run Quick Run Testing in Test Ops/sec Jquery css() $('#test' ).css ('background-color' , '#000000' );
ready
Raw style document .getElementById ('test' ).style .backgroundColor = "#000000" ;
ready
Custom css() function css ([document .getElementById ('test' )], {
backgroundColor : "#000000"
});
ready
Custom css2() function css2 (document .getElementById ('test' ), {
backgroundColor : "#000000"
});
ready
Custom css2() function, array css2 ([document .getElementById ('test' )], {
backgroundColor : "#000000"
});
ready
Revisions You can edit these tests or add more tests to this page by appending /edit to the URL.
Revision 1 : published on May 24, 2011 Revision 2 : published by Jonathan on December 6, 2011 Revision 3 : published by Jonathan on December 6, 2011 Revision 4 : published by 51L3N7 on December 6, 2011 Revision 5 : published on February 6, 2012 Revision 6 : published on February 6, 2012 Revision 7 : published by Marcin on July 8, 2012 Revision 8 : published on July 8, 2012 Revision 10 : published on January 3, 2013 Revision 12 : published on February 8, 2013 Revision 13 : published on March 19, 2013 Revision 14 : published by Levi Hackwith on March 21, 2013 Revision 15 : published on May 13, 2013 Revision 16 : published on July 10, 2013 Revision 17 : published on July 10, 2013 Revision 18 : published on July 10, 2013 Revision 19 : published on July 26, 2013 Revision 20 : published on July 26, 2013 Revision 21 : published on August 6, 2013 Revision 22 : published on August 19, 2013 Revision 23 : published on September 5, 2013 Revision 24 : published on September 24, 2013 Revision 25 : published on October 27, 2013 Revision 26 : published on November 20, 2013 Revision 27 : published on December 12, 2013 Revision 28 : published on December 16, 2013 Revision 29 : published on December 16, 2013 Revision 30 : published on January 9, 2014 Revision 31 : published on February 3, 2014 Revision 32 : published by m_gol on March 10, 2014 Revision 33 : published on July 11, 2014 Revision 35 : published on October 1, 2014