getters setters performance (v4)

Revision 4 of this benchmark created on


Setup

class Foo {
	_a = 0
	
	set 0(val) {
		this._a = val
	}
	
	get 0() {
		return this._a
	}
}

const plainArray = [0];

const foo = new Foo()

Test runner

Ready to run.

Testing in
TestOps/sec
Class getters
foo[0]
ready
Class setters
foo[0] += 1
ready
Plain Array get
plainArray[0]
ready
Plain Array set
plainArray[0] += 1
ready

Revisions

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