Private vs Public methods (v24)

Revision 24 of this benchmark created on


Setup

class CPrivate {
	#pri0() {}
	#pri1() {}
	#pri2() {}
	#pri3() {}
	#pri4() {}
	#pri5() {}
	#pri6() {}
	#pri7() {}
	#pri8() {}
	#pri9() {}
	run() {
		this.#pri0();
		this.#pri1();
		this.#pri2();
		this.#pri3();
		this.#pri4();
		this.#pri5();
		this.#pri6();
		this.#pri7();
		this.#pri8();
		this.#pri9();
	}
}

const pri = new CPrivate();

function pub0() {}
function pub1() {}
function pub2() {}
function pub3() {}
function pub4() {}
function pub5() {}
function pub6() {}
function pub7() {}
function pub8() {}
function pub9() {}

class CPublic {
	run() {
		pub0();
		pub1();
		pub2();
		pub3();
		pub4();
		pub5();
		pub6();
		pub7();
		pub8();
		pub9();
	}
}

const pub = new CPublic();

Test runner

Ready to run.

Testing in
TestOps/sec
private method
pri.run();
ready
public method
pub.run();
ready

Revisions

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