Test name | Executions per second |
---|---|
Spread | 1397394.9 Ops/sec |
Object.assign | 2380346.5 Ops/sec |
Foreach | 2271430.2 Ops/sec |
just for | 6748000.0 Ops/sec |
const a = {
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"
};
let 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,
a
};
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
}
const a = {
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"
};
let 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,
a
};
Object.assign(res, b);
Object.assign(res, c);
const a = {
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"
};
const 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,
a
};
Object.keys(b).forEach(key => {
res[key] = b[key];
});
Object.keys(c).forEach(key => {
res[key] = c[key];
});
const a = {
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"
};
const 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,
a
};
for (const key in b) {
res[key] = b[key];
}
for (const key in c) {
res[key] = c[key];
}