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 = '<div class="mv-hide" id="most-visited"><div id="mv-tiles" style="width: 620px;"><div class="mv-row"><div class="mv-tile mv-page" tabindex="1"><iframe id="title-0" src="chrome-search://most-visited/title.html?rid=1&c=777777&f=arial%2Csans-serif&fs=11&ts=&pos=0" class="mv-title" tabindex="-1"></iframe><iframe id="thumb-0" src="chrome-search://most-visited/thumbnail.html?rid=1&c=777777&f=arial%2Csans-serif&fs=11&ts=&pos=0" allowtransparency="true" class="mv-thumb" tabindex="-1"></iframe><div class="mv-mask"></div><div class="mv-x" title="Dont show on this page"></div><img class="mv-fav" src="chrome-search://favicon/size/16@1x/2/1"></div><div class="mv-tile mv-page" tabindex="1"><iframe id="title-1" src="chrome-search://most-visited/title.html?rid=2&c=777777&f=arial%2Csans-serif&fs=11&ts=&pos=1" class="mv-title" tabindex="-1"></iframe><iframe id="thumb-1" src="chrome-search://most-visited/thumbnail.html?rid=2&c=777777&f=arial%2Csans-serif&fs=11&ts=&pos=1" allowtransparency="true" class="mv-thumb" tabindex="-1"></iframe><div class="mv-mask"></div><div class="mv-x" title="Dont show on this page"></div><img class="mv-fav" src="chrome-search://favicon/size/16@1x/2/2"></div><div class="mv-tile mv-page" tabindex="1"><iframe id="title-2" src="chrome-search://most-visited/title.html?rid=3&c=777777&f=arial%2Csans-serif&fs=11&ts=&pos=2" class="mv-title" tabindex="-1"></iframe><iframe id="thumb-2" src="chrome-search://most-visited/thumbnail.html?rid=3&c=777777&f=arial%2Csans-serif&fs=11&ts=&pos=2" allowtransparency="true" class="mv-thumb" tabindex="-1"></iframe><div class="mv-mask"></div><div class="mv-x" title="Dont show on this page"></div><img class="mv-fav" src="chrome-search://favicon/size/16@1x/2/3"></div><div class="mv-tile mv-page" tabindex="1"><iframe id="title-3" src="chrome-search://most-visited/title.html?rid=4&c=777777&f=arial%2Csans-serif&fs=11&ts=&pos=3" class="mv-title" tabindex="-1"></iframe><iframe id="thumb-3" src="chrome-search://most-visited/thumbnail.html?rid=4&c=777777&f=arial%2Csans-serif&fs=11&ts=&pos=3" allowtransparency="true" class="mv-thumb" tabindex="-1"></iframe><div class="mv-mask"></div><div class="mv-x" title="Dont show on this page"></div><img class="mv-fav" src="chrome-search://favicon/size/16@1x/2/4"></div></div><div class="mv-row"><div class="mv-tile mv-page" tabindex="1"><iframe id="title-4" src="chrome-search://most-visited/title.html?rid=5&c=777777&f=arial%2Csans-serif&fs=11&ts=&pos=4" class="mv-title" tabindex="-1"></iframe><iframe id="thumb-4" src="chrome-search://most-visited/thumbnail.html?rid=5&c=777777&f=arial%2Csans-serif&fs=11&ts=&pos=4" allowtransparency="true" class="mv-thumb" tabindex="-1"></iframe><div class="mv-mask"></div><div class="mv-x" title="Dont show on this page"></div><img class="mv-fav" src="chrome-search://favicon/size/16@1x/2/5"></div><div class="mv-tile mv-page" tabindex="1"><iframe id="title-5" src="chrome-search://most-visited/title.html?rid=6&c=777777&f=arial%2Csans-serif&fs=11&ts=&pos=5" class="mv-title" tabindex="-1"></iframe><iframe id="thumb-5" src="chrome-search://most-visited/thumbnail.html?rid=6&c=777777&f=arial%2Csans-serif&fs=11&ts=&pos=5" allowtransparency="true" class="mv-thumb" tabindex="-1"></iframe><div class="mv-mask"></div><div class="mv-x" title="Dont show on this page"></div><img class="mv-fav" src="chrome-search://favicon/size/16@1x/2/6"></div><div class="mv-tile mv-page" tabindex="1"><iframe id="title-6" src="chrome-search://most-visited/title.html?rid=7&c=777777&f=arial%2Csans-serif&fs=11&ts=&pos=6" class="mv-title" tabindex="-1"></iframe><iframe id="thumb-6" src="chrome-search://most-visited/thumbnail.html?rid=7&c=777777&f=arial%2Csans-serif&fs=11&ts=&pos=6" allowtransparency="true" class="mv-thumb" tabindex="-1"></iframe><div class="mv-mask"></div><div class="mv-x" title="Dont show on this page"></div><img class="mv-fav" src="chrome-search://favicon/size/16@1x/2/7"></div><div class="mv-tile mv-page" tabindex="1"><iframe id="title-7" src="chrome-search://most-visited/title.html?rid=8&c=777777&f=arial%2Csans-serif&fs=11&ts=&pos=7" class="mv-title" tabindex="-1"></iframe><iframe id="thumb-7" src="chrome-search://most-visited/thumbnail.html?rid=8&c=777777&f=arial%2Csans-serif&fs=11&ts=&pos=7" allowtransparency="true" class="mv-thumb" tabindex="-1"></iframe><div class="mv-mask"></div><div class="mv-x" title="Dont show on this page"></div><img class="mv-fav" src="chrome-search://favicon/size/16@1x/2/8"></div></div></div><div class="mv-noti-hide" id="mv-noti"><span id="mv-noti-msg">Thumbnail removed.</span><span id="mv-noti-lks"><span id="mv-undo" tabindex="1">Undo</span><span id="mv-restore" tabindex="1">Restore all</span><button class="mv-x" id="mv-noti-x" tabindex="1"></button></span></div><div class="mv-noti-hide" id="mv-noti-error"><span id="mv-noti-msg">Error removing thumbnail; Chrome needs to be online.</span></div></div>'
Ready to run.
Test | Ops/sec | |
---|---|---|
removeChildFirst |
| ready |
innerHTML |
| ready |
removeChildLast |
| ready |
removeChildLast with display="none" |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.