Cache selectors

JavaScript performance comparison

Test case created by josh

Preparation code

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


<div class="textwidget"><div class="extendoBox">
<div>
<!--<h6>Online Training for Business</h6>
<p><h5>&bull; Quickly create compelling courses with your content</h5></p>
<p><h5>&bull; Increase training efficiency and reduce costs</h5></p>
<p><h5>&bull;  Easily evaluate the impact of training on business success</h5></p>-->

<h6>Online Training Made Easy</h6>
<p>Create Courses Quickly
<br>Save Time and Money
<br>Measure Results</p>

<a href="/sign-up">Sign up for free trial</a>
<p style="font-size: 11px; font-style: italic; margin: -17px 0 -27px 0; height: 65px; padding-left:50px;">No Credit Card Required</p>
<div id="testDiv"></div>
<div>
<a href="javascript:void(0)" role="button" class="play">Watch and learn more</a>
<!--<a href="javascript:void(0)" role="button" class="play">Watch this two-minute video to see how to make training easier and more productive</a>-->
</div>
</div>
</div>
<div id="videoModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                <div id="sh-wrapper">
                       
                </div>
        </div></div>

Preparation code output

Online Training Made Easy

Create Courses Quickly
Save Time and Money
Measure Results

Sign up for free trial

No Credit Card Required

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
No caching
var i = 10;

while (i) {
  $('#testDiv').width();
  i--;
}
pending…
With caching
var i = 10;
var testDiv = $('#testDiv');

while (i) {
  testDiv.width();
  i--;
}
pending…

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

Compare results of other browsers

0 comments

Add a comment