Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
FAQ
Register
Log In
Run results for:
getElementById raw vs function
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:155.0) Gecko/20100101 Firefox/155.0
Browser:
Firefox 155
Operating system:
Mac OS X 10.15
Device Platform:
Desktop
Date tested:
8 days ago
Benchmark engine:
Benchmark.js
with function
1580.4M/s
getElemntByID
10.9M/s
View exact numbers
Test name
Executions per second
✓
with function
1,580,440,960 Ops/sec
getElemntByID
10,922,854 Ops/sec
HTML Preparation code:
<!--your preparation HTML code goes here--> <div id="elementWithId"></div>
Script Preparation code:
/*your preparation JavaScript code goes here To execute async code during the script preparation, wrap it as function globalMeasureThatScriptPrepareFunction, example:*/ async function globalMeasureThatScriptPrepareFunction() { // This function is optional, feel free to remove it. // await someThing(); } const el = (id) => document.getElementById(id)
Tests:
getElemntByID
/*When writing async/deferred tests, use `deferred.resolve()` to mark test as done*/ const element = document.getElementById("elementWithId")
with function
const element = el("elementWithId")