Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
elementFromPoint
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/126.0.0.0 Safari/537.36
Browser:
Chrome 126
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
elementFromPoint
383.7 Ops/sec
second
417341.9 Ops/sec
HTML Preparation code:
<style> #container * { display: flex; flex: 1 1 50px; background: red; } #container .tick { flex-direction: row width: 20px; height: auto; } #container .tock { flex-direction: column width: auto; height: 20px; } </style> <div id="container"></div>
Script Preparation code:
const container = document.getElementById("container"); const depth = 10; const childrenPerLevel = 3; /** * @param {HTMLElement} parent * @param {boolean} isTick */ const addElement = (parent, isTick) => { const el = document.createElement("div"); el.classList.add(isTick ? "tick" : "tock"); parent.appendChild(el); return el; }; let currLevel = [container]; let nextLevel = []; for (let i = 0; i < depth; i++) { for (const parent of currLevel) { for (let j = 0; j < childrenPerLevel; j++) { nextLevel.push(addElement(parent, i % 2 === 0)); } } currLevel = nextLevel; nextLevel = []; }
Tests:
elementFromPoint
const n = 1000; const nsq = Math.floor(Math.sqrt(n)); const arr = Array(n).fill(0).map((v,i)=>i); arr.map((v,i)=>document.elementFromPoint(i%nsq, Math.floor(i/nsq)));
second
console.log(".");