lazy in Ruby is about 1.5x faster than
transducers . 🙃
But it consumes more memory.
Here is my adopted to Ruby version of your benchmark (only with max value): https://gist.github.com/AlexWayfer/8affba5fa6b4f29b7cc1f22de9e85d9c
Siim Liiser — lazy is not the same as using transducer-like pattern.
`Lazy` is SLOW. It’s advantage — it can be used when processing whole data structure is difficult or impossible — for example when working on an infinite sequence. Otherwise `lazy`enumerator is about 6x slower than using transducers, or about 5x slower…
This reminds me of Steve Yegg’s theory of software liberalism/conservatism, just expanded from a two-party model to the full political spectrum.
You being a Red/Blue/Indigo seems contradictory, but I guess it’s like being fiscally conservative and socially liberal.
Personally I think I’m Red/Green.