Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
direct vs indirect var return
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36
Browser:
Chrome 130
Operating system:
Linux
Device Platform:
Desktop
Date tested:
one year ago
indirect 2
22.4M/s
direct
22.3M/s
indirect 1
20.8M/s
View exact numbers
Test name
Executions per second
✓
indirect 2
22,438,668 Ops/sec
direct
22,288,772 Ops/sec
indirect 1
20,809,578 Ops/sec
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();