variable-caching-jquery

Benchmark created by Kris Krause on


Preparation HTML

<div id="test">
</div>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>

Test runner

Ready to run.

Testing in
TestOps/sec
No-Cache
for (var i = 0; i < 10; i++) {
   var z = $("#id").outerHeight(true);
}
ready
Cache
var id = $("#id");

for (var i = 0; i < 10; i++) {
   var z = id.outerHeight(true);
}
ready

Revisions

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

  • Revision 1: published by Kris Krause on