Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
style vs. style.cssText
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64; rv:137.0) Gecko/20100101 Firefox/137.0
Browser:
Firefox 137
Operating system:
Linux
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
style
470.3 Ops/sec
style.cssText
514.8 Ops/sec
HTML Preparation code:
<div id='a'>foo</div> <div id='b'>bar</div>
Script Preparation code:
var a = document.getElementById('a'); var b = document.getElementById('b');
Tests:
style
a.style.fontSize = `${20 * Math.random()}px`; a.style.letterSpacing = `-${Math.random()}em`; a.style.wordSpacing = '0em'; const x = a.getBoundingClientRect();
style.cssText
b.style.cssText = ` font-size: ${20 * Math.random()}px; letter-spacing: -${Math.random()}em; word-spacing: 0em; `; const x = b.getBoundingClientRect();