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 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36
Browser:
Chrome 124
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
Object.assign
4141319.0 Ops/sec
Spread
8388081.5 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 };