jQuery Animation : step performance (v2)

Revision 2 of this benchmark created on


Preparation HTML

<div id="tester">Hi</div>

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

Setup

var x = 100;

Teardown


    $('#tester').stop().css({
      "opacity": 1,
      "width":200
    });
  

Test runner

Ready to run.

Testing in
TestOps/sec
Usual
$('#tester').animate({
  "opacity":50/x,
  "width":x
},500)
ready
Step
$('#tester').animate({
  "customRatio": x,
},{
  "duration": 500,
  "step": function(a,b){
    if (b.prop = "customRatio") {
      $(this).css({
        "opacity":50/a,
        "width":a
      })
    }
  }
})
ready

Revisions

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