Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
external vs member vs static funcs
(version: 1)
Compares funcs
Comparing performance of:
staticFunc vs memberFunc vs externalFunc
Created:
10 months ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
class SomeClass { static staticFunc() {console.log('test')} memberFunc() {console.log('test');} } const externalFunc = () => console.log('test'); const instance = new SomeClass();
Tests:
staticFunc
SomeClass.staticFunc();
memberFunc
instance.memberFunc();
externalFunc
externalFunc();
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
staticFunc
memberFunc
externalFunc
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
10 months ago
)
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36
Browser/OS:
Chrome 137 on Mac OS X 10.15.7
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
staticFunc
642040.5 Ops/sec
memberFunc
638836.4 Ops/sec
externalFunc
629418.2 Ops/sec
Related benchmarks:
Ts trivial getter vs method
closure vs proto2
Class method / instance method / bind this
Class instance method lookup vs function-created object method lookup
InstanceOf vs String type 2
Dynamic class vs object
new class vs function returning obj
class vs object vs function
new EmptyClass VS Object.create(EmptyClass)
Comments
Confirm delete:
Do you really want to delete benchmark?