Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Check JS spread operator vs Object.assign performance
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36
Browser:
Chrome 125
Operating system:
Linux
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
Object.assign
7796748.0 Ops/sec
Spread
14986648.0 Ops/sec
Tests:
Object.assign
const a = { 'a': '1', 'b1': '2', 'b2': '2', 'b3': '2', 'b4': '2', 'b5': '2', } const b = { 'a': '2', 'c': '3', } const c = { 'a': '3', } const finalObject = Object.assign({}, {a, b,c });
Spread
const a = { 'a': '1', 'b1': '2', 'b2': '2', 'b3': '2', 'b4': '2', 'b5': '2', } const b = { 'a': '2', 'c': '3', } const c = { 'a': '3', } const finalObject = { ...a, ...b, ...c };