object inject (v2)

Revision 2 of this benchmark created on


Setup

const a = {};

for (let i = 0; i < 100; i++) {
	a[i] = i;
}

const b = {}
for (let j = 200; j < 210; j++) {
	b[j] = j;
}

a.__proto__ = b;

Test runner

Ready to run.

Testing in
TestOps/sec
plain assign
for (let i = 200; i < 210; i++) {
	a[i] = i+100;
}
ready
modify __proto__
for (let i = 200; i < 210; i++) {
	a.__proto__[i] = i+100;
}
ready

Revisions

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