Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Direct call vs bind vs call vs apply in classes
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/126.0.0.0 Safari/537.36
Browser:
Chrome 126
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
direct call
21160562.0 Ops/sec
bind
21429372.0 Ops/sec
call
10341995.0 Ops/sec
apply
10376101.0 Ops/sec
Script Preparation code:
class Test { msg = 'hello' test(more) { return this.msg + more } } var t = new Test() var orig = t.test var bound = orig.bind(t)
Tests:
direct call
t.test("world");
bind
bound('world')
call
orig.call(t, "world");
apply
orig.apply(t, ["world"]);