X Y pairs

Benchmark created on


Preparation HTML


Setup

var ct = 1000
var arr = []
for (let i = 0; i < ct; i++) arr.push({ x: Math.random(), y: Math.random() })

Test runner

Ready to run.

Testing in
TestOps/sec
Base
for (let i = 0; i < ct; i++) {
	arr[i].x
	arr[i].y
}
ready
Access
for (let i = 0; i < ct; i++) {
	const x = arr[i].x;
	const y = arr[i].y;
}
ready
Destructure
for (let i = 0; i < ct; i++) {
	const { x, y } = arr[i]
}
ready

Revisions

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