Lazy Loop Fusion vs Traditional Method Chaning vs Manual Loop Fusion

JavaScript performance comparison

Revision 5 of this test case created by John Bender

Info

This tests the performance of a lazy loop fusion proxy for jQuery against traditional method chaining and manual loop fusion.

Preparation code

<script src="//code.jquery.com/jquery-1.7.2.js"></script>
<script src="https://raw.github.com/johnbender/jquery-lazy-proxy/master/lazy.js"></script>
<script src="https://raw.github.com/johnbender/jquery-lazy-proxy/master/test/proxies-perf.js"></script>
<script>
window.testSetDivs3 = $( "[data-test]" );
window.testSetDivs2 = $( "[data-test]" );
window.testSetDivs = $( "[data-test]" );
</script>

Preparation code output

Test runner

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

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
Lazily Fused Add/Remove Class w/ Selection
$( "[data-test]" ).lazyAddClass().lazyClearClass().force();
pending…
Vanilla Chain Add/Remove Class w/ Selection
$( "[data-test]" ).simpleAddClass().simpleClearClass();
pending…
Manually Fused Add/Remove Class w/o Selection
$( "[data-test]" ).manualAddClearClass();
 
pending…
Lazily Fused Add/Remove Class w/ Selection
window.testSetDivs.lazyAddClass().lazyClearClass().force();
pending…
Vanilla Chain Add/Remove w/ Select
window.testSetDivs2.simpleAddClass().simpleClearClass();
pending…
Manually Fused Add/Remove w/o Select
window.testSetDivs3.manualAddClearClass();
pending…

Compare results of other browsers

Revisions

You can edit these tests or add even more tests to this page by appending /edit to the URL. Here’s a list of current revisions for this page:

0 comments

Add a comment