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 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Mobile Safari/537.36
Browser:
Chrome Mobile 118
Operating system:
Android
Device Platform:
Mobile
Date tested:
2 years ago
Test name
Executions per second
style
2238.5 Ops/sec
style.cssText
2422.3 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();