Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
window.getComputedStyle vs. getBoundingClientRect
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (iPad; CPU iPhone OS 15_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.7 Mobile/15E148 Safari/604.1 Lark/7.18.0 LarkLocale/zh_CN ChannelName/Feishu LKBrowserIdentifier/9CDAAB05-A318-4BFF-A0F4-DDEB290D30C1
Browser:
Mobile Safari 15
Operating system:
iOS 15.7
Device Platform:
Tablet
Date tested:
2 years ago
Test name
Executions per second
getComputedStyle
321.1 Ops/sec
getBoundingClientRect
394.0 Ops/sec
HTML Preparation code:
<div id="foo"></div>
Tests:
getComputedStyle
var i = 5000; while (i--) { checkDisplay('foo'); } function checkDisplay(id) { return window.getComputedStyle(document.getElementById(id), null).getPropertyValue("display") === "none"; }
getBoundingClientRect
var i = 5000; while (i--) { checkDisplay('foo'); } function checkDisplay(id) { return document.getElementById(id).getBoundingClientRect().width === 0; }