Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
CSS variables VS Set property fixed
(version: 1)
Comparing performance of:
Transform vs CSS property
Created:
10 months ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<div> <img class="js-image"/> </div>
Script Preparation code:
const imageToScale = document.querySelector('.js-image');
Tests:
Transform
imageToScale.style.transform = `scale(${0.5})`;
CSS property
imageToScale.style.setProperty('--motion-scale', 0.5);
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
Transform
CSS property
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
10 months ago
)
User agent:
Mozilla/5.0 (X11; Linux x86_64; rv:139.0) Gecko/20100101 Firefox/139.0
Browser/OS:
Firefox 139 on Linux
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
Transform
704794.6 Ops/sec
CSS property
567993.8 Ops/sec
Related benchmarks:
replaceWith vs innerHTML
6 properties - style.setProperty vs style.cssText vs style vs Object.assign vs setAttribute yeeeeee pt 2
Body vs Tagname
el.style vs cached style vs el.style.setProperty vs cached style.setProperty
CSS variables VS Set property
setProperty vs .cssPropertyName
setProperty
styleProperty
querySelect speed
Comments
Confirm delete:
Do you really want to delete benchmark?