Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
dsadad
(version: 0)
asdasdasdas
Comparing performance of:
asdasdas vs dadadasdas
Created:
6 years ago
by:
Guest
Jump to the latest result
Script Preparation code:
function mergeDeep(target, source) { const isObject = (obj) => obj && typeof obj === 'object'; if (!isObject(target) || !isObject(source)) { return source; } Object.keys(source).forEach(key => { const targetValue = target[key]; const sourceValue = source[key]; if (Array.isArray(targetValue) && Array.isArray(sourceValue)) { target[key] = targetValue.concat(sourceValue); } else if (isObject(targetValue) && isObject(sourceValue)) { target[key] = mergeDeep(Object.assign({}, targetValue), sourceValue); } else { target[key] = sourceValue; } }); return target; } var state = { flag: false, text: 'Default state', nested1: { flag: false, value: 1, text: 'Nested1', deep1: { flag: false, value: 1, text: 'Deep1', }, deep2: { flag: false, value: 1, text: 'Deep2', deeper: { text: 'Very deep', value: 1 } }, }, nested2: { flag: false, value: 2, text: 'Nested2', deep1: { flag: false, value: 1, text: 'Deep1', }, deep2: { flag: false, value: 1, text: 'Deep2', deeper: { text: 'Very deep', value: 1 } }, }, nested3: { flag: false, value: 3, text: 'Nested3', deep1: { flag: false, value: 1, text: 'Deep1', }, deep2: { flag: false, value: 1, text: 'Deep2', deeper: { text: 'Very deep', value: 1, flag: false } }, }, }; var patch = { flag: true, nested1: { flag: true }, nested2: { deep1: { flag: true } }, nested3: { deep2: { deeper: { flag: true } } } }
Tests:
asdasdas
mergeDeep({}, state, patch);
dadadasdas
mergeDeep({}, state, patch);
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
asdasdas
dadadasdas
Fastest:
N/A
Slowest:
N/A
Latest run results:
No previous run results
This benchmark does not have any results yet. Be the first one
to run it!
Related benchmarks:
Lodash Custom Merge
Lodash Custom Merge raf
lodash merge vs object.assign vs spread vs deepMerge util
Lodash vs Object.assign
Comments
Confirm delete:
Do you really want to delete benchmark?