Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
getComputedStyle - call + access variations.
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/130.0.0.0 Safari/537.36
Browser:
Chrome 130
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
Always compute
3573231.5 Ops/sec
Mostly compute
3628342.5 Ops/sec
Stash compute
5790173.5 Ops/sec
HTML Preparation code:
<style type="text/css"> .ok { gap: 20px } </style> <div class="ok"><div>one</div><div>two</div></div>
Script Preparation code:
var okThen = document.querySelector('.ok'); var alwaysGet = (function () { return function () { return window.getComputedStyle(okThen, null).columnGap || window.getComputedStyle(okThen, null).gap; } })(); var mostlyGet = (function () { return function () { var got = window.getComputedStyle(okThen, null); return got.columnGap || got.gap; } })(); var stashGet = (function () { var got; return function () { got = got || window.getComputedStyle(okThen, null); return got.columnGap || got.gap; } })();
Tests:
Always compute
alwaysGet();
Mostly compute
mostlyGet();
Stash compute
stashGet();