Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
123456tg
(version: 1)
Comparing performance of:
t2 vs t1
Created:
one year ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<div data-role="list"><div class="title">loc</div><span class="area" title="tesr" data-id="9" data-index="0">test</span><span class="area" title="test2" data-index="1">test2</span><span class="area" title="test3" data-index="2">test3</span></div>
Script Preparation code:
function getMoveList(){ let list = document.querySelector('[data-role="list"]'); let area = [...list.querySelectorAll('.area[title]')]; let house = [...list.querySelectorAll('.house[title]')]; let npc = [...list.querySelectorAll('.npc[title]')]; return {area, house, npc, all: [...area, ...house, ...npc]}; }
Tests:
t2
function getRoute(name){ return getMoveList().area.find(el => el.innerText.includes(name)); } for(var i=0;i<100;i++){ let res = getRoute('test2'); console.log(res); }
t1
var Routes = null; Routes = getMoveList().area; function getRoute(name){ if (Routes == null) return console.log('Routes == null'); return Routes.find(el => el.innerText.includes(name)); } for(var i=0;i<100;i++){ let res = getRoute('test2'); console.log(res); }
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
t2
t1
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36
Browser/OS:
Chrome 131 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
t2
132.8 Ops/sec
t1
166.8 Ops/sec
Related benchmarks:
for vs foreach DOM elements
querySelectorAll foreach vs getElementsByClassName [].forEach.call()
querySelectorAll foreach vs getElementsByClassName [].forEach.call() 2
DOM manipulation vs innerhtml long - 1
DOM manipulation vs innerhtml long - 2
Classname v Id
getBBox() vs getBoundingClientRect() vs baseVal
document.getElementById+querySelectorAll
data attributes
Comments
Confirm delete:
Do you really want to delete benchmark?