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
.on('click', ... vs .click(...
<div class="Container">
</div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
</script>
var input_id, input_class;
Benchmark.prototype.setup = function() {
var content = '';
var template = function(i){return };
for (var i = 0, total = 10000; i < total; i++){
content += '<div id="link-div-'+i+'"><a href="#" '+(i%2)&&'id="link-a-'+i+'"'+' class="link link-'+i+'">Link-'+i+'</a></div>';
}
$('.Container').html(content);
input_id = $('#link-div-7478');
input_class = $('#link-div-4478');
};
Ready to run.
Test | Ops/sec | |
---|---|---|
click #id |
| ready |
on #id |
| ready |
click .class |
| ready |
on .class |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.