Get Private vs Public properties (v8)

Revision 8 of this benchmark created on


Setup

class C {
  #pri = 1;
  _pro = 1;
  pub = 1;
  get pri() {
    return this.#pri;
  }
  get pro() {
    return this._pro;
  }
  getPri() {
  	return this.#pri;
  }
  getPro() {
    return this._pro;
  }
}
const c = new C;

Test runner

Ready to run.

Testing in
TestOps/sec
public prop
c.pub;
ready
get "protected" prop
c.pro;
ready
get private prop
c.pri;
ready
getPro
c.getPro();
ready
getPri
c.getPri();
ready

Revisions

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