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
what method for empty a element is faster ?
<div id='box'></div>
var box = document.getElementById('box');
box.innerHTML = '<h1>this is a heading<h1><div id="wrapper">Here is some cmmon content that you might find in a website</div><p>qesdafsdafdsa<p>testasingsda<p>tesa</p><h4>here is some more content<h4><h3>asdf</h3><div>more content</div><h1>this is a heading<h1><div id="wrapper">Here is some cmmon content that you might find in a website</div><p>qesdafsdafdsa<p>testasingsda<p>tesa</p><h4>here is some more content<h4><h3>asdf</h3><div>more content</div><h1>this is a heading<h1><div id="wrapper">Here is some cmmon content that you might find in a website</div><p>qesdafsdafdsa<p>testasingsda<p>tesa</p><h4>here is some more content<h4><h3>asdf</h3><div>more content</div><h1>this is a heading<h1><div id="wrapper">Here is some cmmon content that you might find in a website</div><p>qesdafsdafdsa<p>testasingsda<p>tesa</p><h4>here is some more content<h4><h3>asdf</h3><div>more content</div><h1>this is a heading<h1><div id="wrapper">Here is some cmmon content that you might find in a website</div><p>qesdafsdafdsa<p>testasingsda<p>tesa</p><h4>here is some more content<h4><h3>asdf</h3><div>more content</div><h1>this is a heading<h1><div id="wrapper">Here is some cmmon content that you might find in a website</div><p>qesdafsdafdsa<p>testasingsda<p>tesa</p><h4>here is some more content<h4><h3>asdf</h3><div>more content</div><h1>this is a heading<h1><div id="wrapper">Here is some cmmon content that you might find in a website</div><p>qesdafsdafdsa<p>testasingsda<p>tesa</p><h4>here is some more content<h4><h3>asdf</h3><div>more content</div><h1>this is a heading<h1><div id="wrapper">Here is some cmmon content that you might find in a website</div><p>qesdafsdafdsa<p>testasingsda<p>tesa</p><h4>here is some more content<h4><h3>asdf</h3><div>more content</div><h1>this is a heading<h1><div id="wrapper">Here is some cmmon content that you might find in a website</div><p>qesdafsdafdsa<p>testasingsda<p>tesa</p><h4>here is some more content<h4><h3>asdf</h3><div>more content</div><h1>this is a heading<h1><div id="wrapper">Here is some cmmon content that you might find in a website</div><p>qesdafsdafdsa<p>testasingsda<p>tesa</p><h4>here is some more content<h4><h3>asdf</h3><div>more content</div>';
Ready to run.
Test | Ops/sec | |
---|---|---|
removeChild |
| ready |
removeChild 2 |
| ready |
innerHTML |
| ready |
removeEntire |
| ready |
textContent |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.