jQuery Cached Set (v32)

Revision 32 of this benchmark created on


Preparation HTML

<style>
.clase{
color: "#ff0000";
text-decoration: "underline";
background-color: "#eeeeee";
}
</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
</script>
<div id="top" class="mydiv">
  <p id="para_1" class="mytext">
    <input type="checkbox" id="check" name="check" value="Paragraph one" checked="checked" />
    <input type="checkbox" id="check" name="check" value="Paragraph one 2" />
  </p>
<script>
  var cached = jQuery('#top').find('p.mytext');
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
Cached elements
cached.css('color', '#ff0000');
cached.css('text-decoration', 'underline');
cached.css('background-color', '#eeeeee');
ready
No cache
cached.addClass("clase");
ready
Cache2
jQuery('#top').find('checkbox.checked')
ready
Cach3
cached.css({
  "color": "#ff0000",
  "text-decoration": "underline",
  "background-color": "#eeeeee"
});
ready

Revisions

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