assing length

Benchmark created on


Setup

var o1 = { q: 5, w: 10, e: 'asd' };
var o2 = { a: 20, s: 30, d: new Date() };
var o3 = { q: 11.1, a: 22 };
var o_onceField = { q2: 5 };
var o_manyFields = { a2: 20, s2: 30, d2: new Date(), w2: 10, e2: 'asd', z2: 11.1, x2: null, c2: 22 };

Test runner

Ready to run.

Testing in
TestOps/sec
{}, o1
var rr = Object.assign({}, o1);
ready
{}, o_onceField
var rr = Object.assign({}, o_onceField );
ready
{}, o_manyFields
var rr = Object.assign({}, o_manyFields );
ready
{}, { many fields }
var rr = Object.assign({}, { a2: 20, s2: 30, d2: new Date(), w2: 10, e2: 'asd', z2: 11.1, x2: null, c2: 22 });
ready
{}, o1, o2
var rr = Object.assign({}, o1, o2);
ready
{}, o1, o3
var rr = Object.assign({}, o1, o3);
ready
{}, o2, o3
var rr = Object.assign({}, o2, o3);
ready
{}, o_onceField , o_manyFields
var rr = Object.assign({}, o_onceField , o_manyFields );
ready
{}, o1, o2, o3
var rr = Object.assign({}, o1, o2, o3 );
ready
o3, o2, o1
var rr = Object.assign({}, o3, o2, o1);
ready
o3, o2, o1, o_onceField
var rr = Object.assign({}, o3, o2, o1, o_onceField);
ready
o3, o2, o1, o_onceField, o_manyFields
var rr = Object.assign({}, o3, o2, o1, o_onceField, o_manyFields);
ready

Revisions

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