Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
style vs style.cssText benchmark
(version: 0)
Comparing performance of:
style.cssText vs style
Created:
5 years ago
by:
Guest
Jump to the latest result
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.cssText
b.style.cssText = ` font-size: ${20 * Math.random()}px; letter-spacing: -${Math.random()}em; word-spacing: 0em; `; const x = b.getBoundingClientRect();
style
b.style = ` font-size: ${20 * Math.random()}px; letter-spacing: -${Math.random()}em; word-spacing: 0em; `; const x = b.getBoundingClientRect();
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
style.cssText
style
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
3 months ago
)
User agent:
Mozilla/5.0 (X11; Linux x86_64; rv:146.0) Gecko/20100101 Firefox/146.0
Browser/OS:
Firefox 146 on Linux
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
style.cssText
2488.8 Ops/sec
style
1778.4 Ops/sec
Related benchmarks:
querySelector vs getElementById
Umbrella vs Vanilla JS GetID Speed Test2
Umbrella old vs Vanilla JS GetID Speed Test
getElementById VS querySelector (simple comparison)
getElementById vs getElementsByClassName a
Comments
Confirm delete:
Do you really want to delete benchmark?