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; rv:132.0) Gecko/20100101 Firefox/132.0
Browser:
Firefox 132
Operating system:
Mac OS X 10.15
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
Always compute
4353609.5 Ops/sec
Mostly compute
4437836.0 Ops/sec
Stash compute
9229050.0 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();