.toggleClass()

JavaScript performance comparison

Test case created by Nathan

Preparation code

<button id="btn-test" class="btn-class">#btn-test</button>

<script src="https://fireboltjs.com/firebolt.min.js"></script>
<script src="https://zeptojs.com/zepto.min.js"></script>
<script src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
<script>
var btnFirebolt = Firebolt('#btn-test'),
    btnZepto = Zepto('#btn-test'),
    btnJQ = jQuery('#btn-test');
</script>
    

Preparation code output

<button id="btn-test" class="btn-class">#btn-test</button>

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
Firebolt
btnFirebolt.toggleClass('btn-class');
pending…
Zepto
btnZepto.toggleClass('btn-class');
pending…
jQuery
btnJQ.toggleClass('btn-class');
pending…

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

Compare results of other browsers

0 Comments