Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Object.assign vs element.style.*
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36
Browser:
Chrome 129
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
Object.assign
303730.3 Ops/sec
style.*
255145.8 Ops/sec
HTML Preparation code:
<div id="el"> <h2>Lorem ipsum dolor sit amet</h2> </div>
Script Preparation code:
var el = document.getElementById("el");
Tests:
Object.assign
Object.assign(el.style, { top: "3px", height: "10px", left: "50px", transition: "left 0.5s ease", });
style.*
el.style.top= "3px"; el.style.height="10px"; el.style.left= "50px"; el.style.transition= "left 0.5s ease";