Object assign vs Object spread with existing source (v6)

Revision 6 of this benchmark created on


Setup

let a = { a: 1, b: 2, c: 3, d: 4, e: 5 };
let b = {
	f: "5", g: "4", h: "3", i: "2", m: "1"
};

Test runner

Ready to run.

Testing in
TestOps/sec
Object.assign without mutation
Object.assign({}, a, b);
ready
Spread operator
a = {a: 1, ...a,...b};
ready
Object.assign with mutation
Object.assign(a, b);
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.