getter vs method

Benchmark created on


Setup

const o1 = {
	get value() {
    	return 1
	}
}

const o2 = {
	getValue() {
		return 1
	}
}

Test runner

Ready to run.

Testing in
TestOps/sec
getter
let c = o1.value
ready
methd
let c = o2.getValue()
ready

Revisions

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