cowbell-CSS Styles (v2)

Revision 2 of this benchmark created on


Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<div id="foo"></div>
<style>
  .bar {
    margin-left: 200px;
    margin-right: 200px;
  }
</style>

Setup

var apiSelector = document.getElementById("foo");
    var jQuerySelector = $("#foo");
    var clist = apiSelector.classList;
    apiSelector.cached = clist;

Teardown


    clist.remove("bar");
  

Test runner

Ready to run.

Testing in
TestOps/sec
jQuery
jQuerySelector.css( {
   "margin-left" : "200px", 
   "margin-right" : "200px"
});
ready
DOM API
apiSelector.style.marginLeft  = "200px";
apiSelector.style.marginRight = "200px";
ready
classList cached
clist.add("bar");
ready
classList
apiSelector.classList.add("bar");
ready
classList cached prop
apiSelector.cached.add("bar");
ready

Revisions

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