jsPerf.app is an online JavaScript performance benchmark test runner & jsperf.com mirror. It is a complete rewrite in homage to the once excellent jsperf.com now with hopefully a more modern & maintainable codebase.
jsperf.com URLs are mirrored at the same path, e.g:
https://jsperf.com/negative-modulo/2
Can be accessed at:
https://jsperf.app/negative-modulo/2
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<style type="text/css">
.newClass {
background-color:red;
}
.otherClass {
background-color: green;
}
</style>
<div id="c1"><div class="otherClass">Hi</div></div>
$('#c1').replaceWith('<div id="c1"><div class="otherClass">Hi</div></div>');
Ready to run.
Test | Ops/sec | |
---|---|---|
Remove and Add class |
| ready |
Apply CSS |
| ready |
Add Class |
| ready |
Plain JS Replace Class |
| ready |
Plain JS Replace Class v2 |
| ready |
classList api add+rem |
| ready |
jQuery Replace Class v2 |
| ready |
jQuery Replace Attr |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.