Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Class method / instance method / bind this – more closer to reality test
(version: 1)
Comparing performance of:
Call class method vs Call instance method vs Call bound method
Created:
one year ago
by:
Guest
Jump to the latest result
Script Preparation code:
window.A = class { a() {} } window.AReady = new A(); window.B = class { b = () => {}; } window.BReady = new B(); window.C = class { constructor() { this.c = this.c.bind(this); } c() {} } window.CReady = new C();
Tests:
Call class method
new A();
Call instance method
new B();
Call bound method
new C();
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
Call class method
Call instance method
Call bound method
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
User agent:
Mozilla/5.0 (X11; Linux x86_64; rv:132.0) Gecko/20100101 Firefox/132.0
Browser/OS:
Firefox 132 on Linux
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
Call class method
1243444736.0 Ops/sec
Call instance method
44239164.0 Ops/sec
Call bound method
34974988.0 Ops/sec
Related benchmarks:
Test private variables vs weakmap
Ts trivial getter vs method
Class method / instance method / bind this
Class method / instance method / bind this – closer to reality test
Classes memory
opaopa
Length validation
Direct call v bind
class public field declaration
Comments
Confirm delete:
Do you really want to delete benchmark?