Object Value

Benchmark created on


Setup

function accessX0(obj) {
	return obj.x;
}

function taint() {
	accessX1({ x: 0, z: 0 });
}

function accessX1(obj) {
	return obj.x;
}

Test runner

Ready to run.

Testing in
TestOps/sec
Single Type
let sum = 0;
for(let i = 0; i < 5000; i++) {
	sum += accessX0({ x: i, y: i });
}
true_sum = sum;
ready
Multi Type
let sum = 0;
taint();
for(let i = 0; i < 5000; i++) {
	sum += accessX1({ x: i, y: i });
}
true_sum = sum;
ready

Revisions

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