foo (v4)

Revision 4 of this benchmark created on


Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
</script>
<style type="text/css">
  .style1 {background-color:#000;}
</style>
<style type="text/css" id="cssPlaceholder">
</style>
<div id="place2">
</div>

Setup

var i = 100;
    var html = '';
    while (i > 0) {
      html += '<div id="div_' + i + '" class="boxes"></<div>';
      i -= 1;
    }
    $('#place2').html(html);
    
    var placeholder = $('#cssPlaceholder');
    var boxes = $('.boxes');

Test runner

Ready to run.

Testing in
TestOps/sec
css
boxes.css({
  'background-color': '#000'
})
ready
addclass
boxes.addClass("style1")
ready
css tag
placeholder.html('.boxes { background-color: #000; }');
ready

Revisions

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