Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
ownerDocument.defaultView vs window.getComputedStyle
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:138.0) Gecko/20100101 Firefox/138.0
Browser:
Firefox 138
Operating system:
Ubuntu
Device Platform:
Desktop
Date tested:
11 months ago
Test name
Executions per second
ownerDocument.defaultView
3183506.2 Ops/sec
window.getComputedStyle
4384484.0 Ops/sec
HTML Preparation code:
<div id="root"><div>
Script Preparation code:
var el = document.getElementById("root"); function getStyle(elem){ var view = elem.ownerDocument.defaultView; if ( !view || !view.opener ) { view = window; } return view.getComputedStyle( elem ); } function getStyle2(elem){ return window.getComputedStyle( elem ); }
Tests:
ownerDocument.defaultView
var computedStyle = getStyle(el);
window.getComputedStyle
var computedStyle = getStyle2(el);