Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Callback vs Class method
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36
Browser:
Chrome 136
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
Callback
398451.4 Ops/sec
Class Method
18605.3 Ops/sec
Tests:
Callback
function someFunction(a) { for (let i = 0; i < 10000; i++) { a({}); } } const someFunction2 = (t) => typeof t === 'object'; someFunction(someFunction2);
Class Method
class A { method(t) { return typeof t === 'object' } } function someFunction(a) { for (let i = 0; i < 10000; i++) { a.method({}); } } someFunction(new A);