Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Direct calls versus external function calls
Compares doing little tasks immediately versus writing a helper function that does it.
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:135.0) Gecko/20100101 Firefox/135.0
Browser:
Firefox 135
Operating system:
Mac OS X 10.15
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
Direct calls
30504702.0 Ops/sec
Function calls
30033634.0 Ops/sec
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
const tabs = { one: { label: 'One' }, two: { label: 'Two' }, three: { label: 'Three' }, four: { label: 'Four' } } function fetchDataForTab(tabName) {} function handleData(data, handler) { // performance optimized const tabNames = Object.keys(data) for (let i = 0; i < tabNames.length; i++) { handler(tabNames[i]) } }
Tests:
Direct calls
// performance optimized const tabNames = Object.keys(tabs) for (let i = 0; i < tabNames.length; i++) { fetchDataForTab(tabNames[i]) }
Function calls
handleData(tabs, fetchDataForTab)