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
<div id="dom_onscreen"></div>
<script>
function addNodes(el, count){
for(var i=0;i<count;++i){
el.appendChild(document.createElement('span'));
}
}
function addNodesFragment(el, count){
var fragment = document.createDocumentFragment();
for(var i=0;i<count;++i){
fragment.appendChild(document.createElement('span'));
}
el.appendChild(fragment);
}
function clearNodes(el){
el.innerHTML = '';
}
function addItems(arr, count){
for(var i=0;i<count;++i){
arr.push({});
}
}
function clearItems(arr){
arr.length = 0;
}
var $dom_onscreen = document.getElementById('dom_onscreen');
var $dom_offscreen = document.createElement('div');
arr = [];
count = 100;
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
dom manipulation ( onscreen ) |
| ready |
dom manipulation ( onscreen using document fragment ) |
| ready |
dom manipulation ( offscreen ) |
| ready |
dom manipulation ( offscreen using document fragment ) |
| ready |
array manipulation |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.