Variable, Object, Array write speed

Benchmark created on


Setup

let x = 10;
let y = 20;

let obj = {x: 10, y:20};

let arr = [10, 20];

Test runner

Ready to run.

Testing in
TestOps/sec
Variable
let blah = 15;


for (let i = 0; i < 100; i++) {
	blah = i;
}
ready
Object
obj.x = 15;

for (let i = 0; i < 100; i++) {
	obj.x = i;
}
ready
Array
arr[0] = 15;

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

Revisions

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