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
A comparison of repeatedly reselecting elements vs firing events. Though the two are unrelated, this test is to compare firing a lot of events vs the common task of selecting something in jQuery.
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="//documentcloud.github.com/underscore/underscore-min.js"></script>
<script src="//backbonejs.org/backbone-min.js"></script>
<div class="some-class" data-something="something"></div>
<div class="some-class" data-something="something"></div>
<div class="some-class" data-something="something"></div>
var fn = function() {},
v = new Backbone.View(),
numEventHandlers = 10,
i;
for (i = 0; i < numEventHandlers; i++) {
v.on("view:event", fn);
}
Ready to run.
Test | Ops/sec | |
---|---|---|
Select some elements via class. |
| ready |
Select some elements via tag. |
| ready |
Select some elements via data attribute. |
| ready |
Select some elements via data attribute value. |
| ready |
Select non-existent elements |
| ready |
Trigger an event with 10 callbacks. |
| ready |
Trigger an event with 0 callbacks. |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.