Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
bind vs arrow (test1)
(version: 1)
Comparing performance of:
bind vs closure
Created:
one year ago
by:
Guest
Jump to the latest result
Tests:
bind
function fn1() { return 1 + 1; } function fn2() { return 2 + 2; } function fn3() { return 3 + 3; } function fn4() { return 4 + 4; } function createSomething() { return [fn1.bind(), fn2.bind(), fn3.bind(), fn4.bind()] } for (let i = 0; i < 100; i++) { let [a, b, c, d] = createSomething(); for (let j = 0; j < 100; j++) { a(); b(); c(); d(); } }
closure
function createSomething() { function fn1() { return 1 + 1; } function fn2() { return 2 + 2; } function fn3() { return 3 + 3; } function fn4() { return 4 + 4; } return [() => fn1(), () => fn2(), () => fn3(), () => fn4()] } for (let i = 0; i < 100; i++) { let [a, b, c, d] = createSomething(); for (let j = 0; j < 100; j++) { a(); b(); c(); d(); } }
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
bind
closure
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
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/OS:
Chrome 136 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
bind
5213.9 Ops/sec
closure
219820.4 Ops/sec
Related benchmarks:
Bind vs Callback
Direct call vs bind vs call vs apply spred
Arrow function vs normal function comparison repeat
Arrow function vs bind function 222
bind vs closure
bind vs closure v2
Normal function vs Arrow function comparison
Time Cost for different calling
bind vs closure (forked)
Comments
Confirm delete:
Do you really want to delete benchmark?