3 ms·
> You can use a mapping transducer to express map, but it's actually going to have slightly worse performance than regular map. That's a strawman argument- Nei
by drcode 12y ago
> You can use a mapping transducer to express map, but it's actually going to have slightly worse performance than regular map.
That's a strawman argument- Neither OP nor my comment made any mention of "map". This is a discussion about reduction and filtering. Yes, using transducers in a way that is silly like you suggest will produce disappointing results.
- adrusi 12y agoBad example, but my point holds. Transducers aren't performance improvers, they're an abstraction over the process of iteration. They actually degrade performance in the absence of a particularly smart inlining compiler.
- drcode 12y ago> They actually degrade performance in the absence of a particularly smart inlining compiler. So it sounds like you're saying that iterators in Rust are faster than transducer-based filter/reduce. I think it's clear that my original point was that transducer-based filter/reduce is faster than lazy-list based filter/reduce, and comparable in performance to a for loop. (in that lazy-list operations are MUCH MUCH slower in most cases for filter reduce operations than the latter two approaches)