Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
higher order function vs simple function perf checkasdasda sdf
(version: 0)
higher order function vs simple function perf check
Comparing performance of:
simple function vs higher order function
Created:
5 years ago
by:
Guest
Jump to the latest result
Script Preparation code:
var artifacts = { getById: () => [] } function flatten(artifacts, artifactId) { const getDependencies1 = (artifactId) => artifacts.getById(artifactId); return [ ...getDependencies1(artifactId) ] } function createFlattenr(artifacts){ const getDependencies2 = (artifactId) => artifacts.getById(artifactId); return (artifactId) => { return [ ...getDependencies2(artifactId) ] } }
Tests:
simple function
for(var i = 0; i < 100; i++) { flatten(artifacts, i) }
higher order function
const f = createFlattenr(artifacts) for(var i = 0; i < 100; i++) { f(i) }
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
simple function
higher order function
Fastest:
N/A
Slowest:
N/A
Latest run results:
No previous run results
This benchmark does not have any results yet. Be the first one
to run it!
Related benchmarks:
Check function. typeof vs constructor + null check
Check function. typeof vs constructor + null check II
Optional chaining vs native code(Opt)
JS Operator vs Function
array fn vs function
Comments
Confirm delete:
Do you really want to delete benchmark?