Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
FAQ
Register
Log In
Run results for:
higher order function vs simple function perf check
higher order function vs simple function perf check
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/131.0.0.0 Safari/537.36
Browser:
Chrome 131
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Benchmark engine:
Benchmark.js
simple function
1.5M/s
higher order function
1.5M/s
View exact numbers
Test name
Executions per second
✓
simple function
1,522,202 Ops/sec
higher order function
1,522,021 Ops/sec
Script Preparation code:
var artifacts = { getById: () => [] }
Tests:
simple function
const flatten = (artifacts, artifactId) => { const getDependencies = (artifactId) => artifacts.getById(artifactId); return [ ...getDependencies(artifactId) ] } for(var i = 0; i < 100; i++) { flatten(artifacts, i) }
higher order function
const createFlattenr = (artifacts) => { const getDependencies = (artifactId) => artifacts.getById(artifactId); return (artifactId) => { return [ ...getDependencies(artifactId) ] } } const flatten = createFlattenr(artifacts) for(var i = 0; i < 100; i++) { flatten(i) }