jquery: chained call vs. seperated vs. json-combined (v2)

Revision 2 of this benchmark created by Matthias Krumm on


Preparation HTML

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

Test runner

Ready to run.

Testing in
TestOps/sec
chained call
$("#foo").css("width", "200px").css("height", "100px");
ready
seperated calls
var d = $("#foo");
d.css("width", "200px");
d.css("height", "100px");
ready
json combined
$("#foo").css({
 "width": "200px",
 "height": "100x"
});
ready
multi css
$("#foo").css("width", "200px");
$("#foo").css("height", "100px");
ready

Revisions

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

  • Revision 2: published by Matthias Krumm on