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
<style>
.flex-column {
display: flex;
flex-direction: column;
}
.max-height{
max-height:100%;
}
</style>
<!-- Removing even one of these flex-columns has a significant effect -->
<div class="flex-column">
<div class="flex-column" >
<div class="flex-column">
<div class="flex-column">
<div class="flex-column">
<div class="flex-column">
<div class="flex-column">
<div class="flex-column">
<div class="flex-column">
<div class="flex-column max-height"> <!-- it doesn't matter which flex-column has the max-height -->
<div class="flex-column">
<div class="flex-column">
<div class="flex-column">
<div class="flex-column">
<div class="flex-column">
<div class="flex-column">
<div class="flex-column">
<div class="flex-column">
<div class="flex-column" id="replacer">
<!-- Each div here adds more time -->
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
function replaceHTMLVerySlowly() {
console.time("timer");
var el=document.getElementById('replacer');
el.innerHTML = el.innerHTML;
el.clientHeight;
console.timeEnd("timer");
}
Ready to run.
Test | Ops/sec | |
---|---|---|
Replace HTML and check Height |
| ready |
Do it again |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.