Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Spread Operator vs Deepmerge (v06112022)
Answering https://stackoverflow.com/questions/58702513/lodash-clone-array-vs-spread-operator#
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/138.0.0.0 Safari/537.36 Edg/138.0.0.0
Browser:
Chrome 138
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
Spread Operator
19584854.0 Ops/sec
deepmerge
1089847.1 Ops/sec
HTML Preparation code:
<script src='https://unpkg.com/deepmerge@4.2.2/dist/umd.js'></script> <script src='https://unpkg.com/lodash@4.17.21/lodash.min.js'></script>
Script Preparation code:
var a = {a: 1, b: 2, c: {d: 'e', e: 'f'}}; var b = {f: {d: 'e', e: 'f'}, g: 1000, h: 'i'};
Tests:
Spread Operator
const res1 = {...a, ...b};
deepmerge
const res2 = deepmerge(a, b)