Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
JavaScript spread operator vs object update performance
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/140.0.0.0 Mobile Safari/537.36
Browser:
Chrome Mobile 140
Operating system:
Android
Device Platform:
Mobile
Date tested:
10 months ago
Using update
25.3M/s
Using Object.assign
5.7M/s
View exact numbers
Test name
Executions per second
✓
Using update
25,273,262 Ops/sec
Using Object.assign
5,734,487 Ops/sec
Tests:
Using update
const firstObject = {} firstObject.sampleData = 'Hello world'; firstObject.moreData = 'foo bar';
Using Object.assign
const firstObject = { sampleData: 'Hello world' } const secondObject = { moreData: 'foo bar' } const finalObject = Object.assign(firstObject, secondObject);