getters setters performance (v14)

Revision 14 of this benchmark created on


Setup

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

const plainArray = [0];

const foo = new Foo()

Test runner

Ready to run.

Testing in
TestOps/sec
Class string getters
foo["a"]
ready
Class string setters
foo["a"] += 1
ready
Class numeric getters
foo[0]
ready
Class string 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.