Script Preparation code:
x
 
window.AClass = class {
  constructor() {
    this.c = () => 5;
  }
  
  b() {
    return 4;
  }
}
window.AFunc = function() {
  function c() {
    return 5;
  }
  
  return {
    b() {
      return 4;
    },
    c,
  };
};
Tests:
  • Class instance method lookup

     
    const a = new AClass();
    a.b();
    a.c();
  • Function-created object method lookup

     
    const a = new AFunc();
    a.b();
    a.c();
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Class instance method lookup
    Function-created object method lookup

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 3 years ago)
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36
Chrome 92 on Linux
View result in a separate tab
Test name Executions per second
Class instance method lookup 3718290.8 Ops/sec
Function-created object method lookup 3443502.0 Ops/sec