utility functions for numeric array manipulation through lambda calculus (aka higher order functions, or HOF for short)
many functions in the "numericarray" module can be recreated here with a much smaller minified-size footprint.
naturally, this comes at a performance cost of around 5 times when dealing with complex equation with many parameters.
however, when dealing with simple computations and few parameters (such as the addition of two arrays), lambdacalc functions
are exactly as fast as their for...loop counterparts, despite the abstraction. this is all thanks to modren JIT.
check out my benchmarks if you're not convinced: (whom am I even speaking to besides myself? go commit sepuku concurrently)
benchmark for abstracting arithmetics as a function then applying it over a loop (aka vectorization):
utility functions for numeric array manipulation through lambda calculus (aka higher order functions, or
HOF
for short)many functions in the "numericarray" module can be recreated here with a much smaller minified-size footprint.
naturally, this comes at a performance cost of around 5 times when dealing with complex equation with many parameters.
however, when dealing with simple computations and few parameters (such as the addition of two arrays), lambdacalc functions are exactly as fast as their
for...loop
counterparts, despite the abstraction. this is all thanks to modren JIT.check out my benchmarks if you're not convinced: (whom am I even speaking to besides myself? go commit sepuku concurrently)
for...loop
computation: