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 jQuery.css() vs. native DOM (v47) Revision 47 of this benchmark created by test on October 8, 2015 Preparation HTML <script src ="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js" > </script >
<div id ="box" > I'm a box</div >
<style >
.newClass{
background: #FF0000;
box-shadow: "1px 1px 5px 5px red";
width: "100px";
height: "100px";
display: "block";
}
</style >
Setup var el = document .getElementById ("box" );
el.className = "" ;
el.setAttribute ("style" , "" );
$el = $(el);
var style = {
background : "#FF0000" ,
"box-shadow" : "1px 1px 5px 5px red" ,
width : "100px" ,
height : "100px" ,
display : "block"
}
Test runner Ready to run.
Run Quick Run Testing in Test Ops/sec jQuery.css() $el.css (style);
ready
Native DOM el.style .background = "#FF0000" ;
el.style .width = "100px" ;
el.style .height = "100px" ;
el.style .display = "block" ;
el.style .boxShadow = "1px 1px 5px 5px red" ;
ready
string1 var keys = Object .keys (style);
var s = "" ;
for (var i = 0 ; i < style.length ; i++) {
s += keys[i] + ":" + style[keys[i]] + ";" ;
}
el.setAttribute ("style" , s);
ready
string2 var keys = Object .keys (style);
var s = "" ;
for (var i = 0 ; i < style.length ; i++) {
s += keys[i] + ":" + style[keys[i]] + ";" ;
}
el.style .cssText = s;
ready
loop var keys = Object .keys (style);
var s = "" ;
for (var i = 0 ; i < style.length ; i++) {
el.style [keys[i]] = style[keys[i]];
}
ready
loop2 var keys = Object .keys (style);
var s = "" ;
for (var i = 0 ; i < style.length ; i++) {
el.style [$.camelCase (keys[i])] = style[keys[i]];
}
ready
Revisions You can edit these tests or add more tests to this page by appending /edit to the URL.
Revision 1 : published by Lee Brimelow on May 18, 2013 Revision 2 : published on May 18, 2013 Revision 3 : published by Moncader on May 18, 2013 Revision 5 : published on May 20, 2013 Revision 6 : published on May 20, 2013 Revision 8 : published by Evan Borden on May 20, 2013 Revision 9 : published by Evan Borden on May 21, 2013 Revision 10 : published by Yukulélé on May 23, 2013 Revision 13 : published on June 6, 2013 Revision 14 : published on June 6, 2013 Revision 16 : published by Daniel Barber on June 12, 2013 Revision 17 : published on August 13, 2013 Revision 18 : published on August 14, 2013 Revision 19 : published by Phillip Gourley on September 10, 2013 Revision 20 : published on October 18, 2013 Revision 21 : published on October 19, 2013 Revision 24 : published on June 16, 2014 Revision 26 : published on October 3, 2014 Revision 27 : published on October 14, 2014 Revision 28 : published on October 24, 2014 Revision 31 : published on February 6, 2015 Revision 32 : published on February 6, 2015 Revision 33 : published on March 25, 2015 Revision 34 : published on March 25, 2015 Revision 35 : published on March 25, 2015 Revision 36 : published on April 20, 2015 Revision 37 : published on April 21, 2015 Revision 38 : published on June 8, 2015 Revision 39 : published by DJ on August 20, 2015 Revision 40 : published on August 27, 2015 Revision 42 : published on August 29, 2015 Revision 43 : published on September 10, 2015 Revision 44 : published on September 10, 2015 Revision 45 : published on September 10, 2015 Revision 46 : published on September 12, 2015 Revision 47 : published by test on October 8, 2015 Revision 49 : published on November 19, 2015 Revision 59 : published on November 21, 2015 Revision 60 : published on November 24, 2015 Revision 61 : published on March 17, 2016 Revision 62 : published on March 21, 2016