Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Test id vs next sibbling
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36
Browser:
Chrome 134
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
next sibbling
658524.9 Ops/sec
based on id
557977.3 Ops/sec
HTML Preparation code:
<div class="js-tooltip" data-tooltip-id="tooltip-123"></div> <div id="tooltip-123" class="c-tooltip">test</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(); }
Tests:
next sibbling
var tooltip = document.getElementsByClassName("js-tooltip")[0]; console.log(tooltip.nextElementSibling[0]);
based on id
var tooltip = document.getElementsByClassName("js-tooltip")[0]; console.log(document.getElementById(tooltip.dataset.tooltipId));