Test (v2)

Revision 2 of this benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
Object
function add (v) {
	return v.x + v.y
}

add({ x: Math.random(), y: Math.random() })
ready
Plain
function add (x, y) {
	return x + y
}

add(Math.random(), Math.random())
ready
Class
class V {
	constructor (x, y) {
		this.x = x
		this.y = y
	}
}

function add (v) {
	return v.x + v.y
}

add(new V(Math.random(), Math.random()))
ready

Revisions

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