Lazy Loop Fusion vs Traditional Method Chaning vs Manual Loop Fusion

JavaScript performance comparison

Revision 5 of this test case created by John Bender

Preparation code

<script src="https://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

<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>

Test runner

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

Java applet disabled.

Testing in CCBot 2.0.0 / Other 0.0.0
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.

0 Comments