Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
elementFromPoint1
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Safari/605.1.15
Browser:
Safari 17
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
2 years ago
Test name
Executions per second
elementFromPoint
1238.8 Ops/sec
second
1414854.4 Ops/sec
HTML Preparation code:
<style> #container { width: 1000px; height: 1000px; } #container * { display: flex; flex: 1 1; background: red; border: 1px solid black; min-width: 0; min-height: 0; width: 100%; height: 100%; } #container .tick { flex-direction: row; } #container .tock { flex-direction: column; } </style> <div id="container"></div>
Script Preparation code:
const container = document.getElementById("container"); const depth = 9; 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(".");