jQuery.css() vs. native DOM (v34)

Revision 34 of this benchmark created on


Preparation HTML

<div id="box">I'm a box</div>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
</script>

Setup

var el = document.getElementById("box");

Teardown



            el = null;
        
  

Test runner

Ready to run.

Testing in
TestOps/sec
jQuery.css()
$(el).css({
  top: (Math.random() * 100 >> 0) + "px"
  left: (Math.random() * 100 >> 0) + "px"
});
ready
Native DOM
el.style.top = (Math.random() * 100 >> 0) + "px";
el.style.left = (Math.random() * 100 >> 0) + "px";
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.