Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Direct return vs Return constant
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/141.0.0.0 Safari/537.36 Edg/141.0.0.0
Browser:
Chrome 141
Operating system:
Windows
Device Platform:
Desktop
Date tested:
6 months ago
Test name
Executions per second
Direct return
17365.2 Ops/sec
Return constant
17276.8 Ops/sec
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
const test1 = () => { const obj = { p0: 1, p1: 2, p2: 3 }; return obj; } const test2 = () => { return { p0: 1, p1: 2, p2: 3 }; }
Tests:
Direct return
for (let i = 0; i < 100000; i++) { const res = test1(); }
Return constant
for (let i = 0; i < 100000; i++) { const res = test2(); }