JQuery Wrapper Performance (v2)

Revision 2 of this benchmark created by Alexander on


Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<p>The queue length is: <span></span></p>

Setup

var bLeft = true;
    var $div = $("div") ;

Test runner

Ready to run.

Testing in
TestOps/sec
jQuerySelector
if(bLeft) {
  $("div").css("left","+=20px");
} else {
  $("div").css("left","-=20px");
}
bLeft = !bLeft;
 
ready
jQuery-No-Selector
if(bLeft) {
  $div.css("left","+=20px");
} else {
  $div.css("left","-=20px");
}
bLeft = !bLeft;
 
ready

Revisions

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

  • Revision 2: published by Alexander on