Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Direct call vs bind vs closure 2
(version: 1)
Comparing performance of:
Explicit parameters vs New parameter object
Created:
3 months ago
by:
Guest
Jump to the latest result
Script Preparation code:
function f1(self) { var m = self.msg; return m; } function f2() { var m = this.msg; return m; } var m = { msg: "Hello" }; var z = (() => f1(m)); var t = new Function("", ` var x = this.x; return x; `).bind({ msg: "Hello" }); for (let i = 0; i < 1000; i++) { t(); }
Tests:
Explicit parameters
z()
New parameter object
t()
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
Explicit parameters
New parameter object
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
3 months ago
)
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36 Edg/143.0.0.0
Browser/OS:
Chrome 143 on Mac OS X 10.15.7
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
Explicit parameters
183640512.0 Ops/sec
New parameter object
182020992.0 Ops/sec
Related benchmarks:
Bind vs closure declaration
bind-2018-test
Direct call vs bind vs call vs apply vs self
Direct call vs bind vs call vs apply vs self but makes sense
Bind vs closure declaration without recalc
Direct call vs saved bind vs inline bind vs call vs apply vs closure
Bind vs closure déclaration 2
Direct call vs bind vs call vs apply vs static bound
Arrow call vs bind vs call vs apply with bound options
Comments
Confirm delete:
Do you really want to delete benchmark?