Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Merge objects performance test
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36
Browser:
Chrome 132
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
Spread
5163386.5 Ops/sec
Object.assign
11650718.0 Ops/sec
Foreach
3487604.2 Ops/sec
just for
5712879.0 Ops/sec
Tests:
Spread
let res = { email: "abc@mail.com", phone: "12345678", }; const b = { app_version: "AP.12", appsflyer_id: "askldjajkshdlkjh2323h4234j2l3j4h", advertising_id: "23;o4h2l34hl2kj3h4kj23h4", device_os_version: "12", device_name: "Aifon 15 PRO", firebase_instance_id: "2liu3hiuo23y4u23y4ui2y34iy3u4y234", }; const c = { first_name: "lalala", last_name: "dadada" }; res = { email: null, phone: null, last_name: null, first_name: null, app_version: null, appsflyer_id: null, advertising_id: null, device_os_version: null, device_name: null, firebase_instance_id: null, ...res, ...b }; res = { email: null, phone: null, last_name: null, first_name: null, app_version: null, appsflyer_id: null, advertising_id: null, device_os_version: null, device_name: null, firebase_instance_id: null, ...res, ...c }
Object.assign
let res = { email: "abc@mail.com", phone: "12345678", }; const b = { app_version: "AP.12", appsflyer_id: "askldjajkshdlkjh2323h4234j2l3j4h", advertising_id: "23;o4h2l34hl2kj3h4kj23h4", device_os_version: "12", device_name: "Aifon 15 PRO", firebase_instance_id: "2liu3hiuo23y4u23y4ui2y34iy3u4y234", }; const c = { first_name: "lalala", last_name: "dadada" }; res = { email: null, phone: null, last_name: null, first_name: null, app_version: null, appsflyer_id: null, advertising_id: null, device_os_version: null, device_name: null, firebase_instance_id: null, ...res }; Object.assign(res, b); Object.assign(res, c);
Foreach
let res = { email: "abc@mail.com", phone: "12345678", }; const b = { app_version: "AP.12", appsflyer_id: "askldjajkshdlkjh2323h4234j2l3j4h", advertising_id: "23;o4h2l34hl2kj3h4kj23h4", device_os_version: "12", device_name: "Aifon 15 PRO", firebase_instance_id: "2liu3hiuo23y4u23y4ui2y34iy3u4y234", }; const c = { first_name: "lalala", last_name: "dadada" }; res = { email: null, phone: null, last_name: null, first_name: null, app_version: null, appsflyer_id: null, advertising_id: null, device_os_version: null, device_name: null, firebase_instance_id: null, ...res }; Object.keys(b).forEach(key => { res[key] = b[key]; }); Object.keys(c).forEach(key => { res[key] = c[key]; });
just for
let res = { email: "abc@mail.com", phone: "12345678", }; const b = { app_version: "AP.12", appsflyer_id: "askldjajkshdlkjh2323h4234j2l3j4h", advertising_id: "23;o4h2l34hl2kj3h4kj23h4", device_os_version: "12", device_name: "Aifon 15 PRO", firebase_instance_id: "2liu3hiuo23y4u23y4ui2y34iy3u4y234", }; const c = { first_name: "lalala", last_name: "dadada" }; res = { email: null, phone: null, last_name: null, first_name: null, app_version: null, appsflyer_id: null, advertising_id: null, device_os_version: null, device_name: null, firebase_instance_id: null, ...res }; for (const key in b) { res[key] = b[key]; } for (const key in c) { res[key] = c[key]; }