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 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36
Browser:
Chrome 125
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
style
9537.4 Ops/sec
style.cssText
10122.4 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();