Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
lambdas-noinline-fun-creation2
(version: 0)
Comparing performance of:
lambda (created each time) vs lambda (created once) vs lambda (side-effect inline) vs lambda (side-effect) vs no lambda
Created:
5 years ago
by:
Guest
Jump to the latest result
Script Preparation code:
var x = []; for(i=0; i<1000; i++){ x.push(i) } function justReturn(item) { return item } function sideEffect2(arr, i) { arr[i] = x[i] }
Tests:
lambda (created each time)
let a1 = []; function justReturn2(item) { return item } for(i=0; i<1000; i++){ a1[i] = justReturn2(x[i]) }
lambda (created once)
let a2 = []; for(i=0; i<1000; i++){ a2[i] = justReturn(x[i]) }
lambda (side-effect inline)
let a3 = []; function sideEffect2(i) { a3[i] = x[i] } for(i=0; i<1000; i++){ sideEffect2(i) }
lambda (side-effect)
let a4 = []; for(i=0; i<1000; i++){ sideEffect(i) }
no lambda
let a5 = []; for(i=0; i<1000; i++){ a5[i] = x[i] }
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (5)
Previous results
Fork
Test case name
Result
lambda (created each time)
lambda (created once)
lambda (side-effect inline)
lambda (side-effect)
no lambda
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:
slice-splice
splice-slice-b
Push vs Spread 2
Slice vs Splice efficiency
push or spread
Comments
Confirm delete:
Do you really want to delete benchmark?