Test name | Executions per second |
---|---|
Lodash merge | 2502013.0 Ops/sec |
object.assign | 5099818.5 Ops/sec |
spread | 19495836.0 Ops/sec |
spread mutate | 20728946.0 Ops/sec |
<script src='https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.5/lodash.min.js'></script>
var a = { a: 'foo', b: 'bar' };
var b = { c: 'foobar' };
var c = _.merge(a, b);
var a = { a: 'foo', b: 'bar' };
var b = { c: 'foobar' };
var c = Object.assign(a, b);
var a = { a: 'foo', b: 'bar' };
var b = { c: 'foobar' };
var c = { a, b };
var a = { a: 'foo', b: 'bar' };
var b = { c: 'foobar' };
a = { a, b };