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="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
</script>
<div id="tree"></div>
function CreateNDepthTree(N) {
if (N == 2) return $('<div/>', {
id: 'context'
}).append(CreateNDepthTree(N - 1));
else if (N == 1) return $('<div></div>', {
class: 'holder'
}).html('<h3>Leaf</h3>');
else return $('<div/>').append(CreateNDepthTree(N - 1));
}
var $context;
$(document).ready(function() {
$context = $("#context");
$('#tree').append(CreateNDepthTree(1000));
});
$('#tree').empty();
Ready to run.
Test | Ops/sec | |
---|---|---|
$(".holder") |
| ready |
$(".holder", "#context") |
| ready |
$(".holder", $("#context")) |
| ready |
$(".holder", $context) |
| ready |
$context.find(".holder") |
| ready |
$context.filter('.holder') |
| ready |
$context.find('*').filter('.holder') |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.