Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
direct vs indirect var return
(version: 3)
Comparing performance of:
indirect 1 vs indirect 2 vs direct
Created:
one year ago
by:
Registered User
Jump to the latest result
Script Preparation code:
const getValueDirect = function() { return 1; }; const getValueIndirect1 = function() { return getValueDirect(); } const getValueIndirect2 = function() { return getValueIndirect1(); }
Tests:
indirect 1
const myValue1 = getValueIndirect1();
indirect 2
const myValue2 = getValueIndirect2();
direct
const myValue3 = getValueDirect();
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
indirect 1
indirect 2
direct
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
5 months ago
)
User agent:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36
Browser/OS:
Chrome 142 on Linux
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
indirect 1
236111200.0 Ops/sec
indirect 2
229970000.0 Ops/sec
direct
228557744.0 Ops/sec
Related benchmarks:
Return true vs empty body
Return true vs empty body
optional function call
isIteratorOrAsyncIterator
return chain vs ref again
function name alias vs invocation
function name alias vs invocation 2
eval vs new Function vs direct execution
typeof function vs call in function
Comments
Confirm delete:
Do you really want to delete benchmark?