Alex Miller <[email protected]> writes:
Hi Alex,
> - Eduction is no longer Seqable and thus the return from eduction is not
> seqable (but it is reducible and iterable). You can use iterator-seq to get a
> chunked seq over the top if you need one.
Really?
user> *clojure-version*
{:major 1, :minor 7, :incremental 0, :qualifier "alpha6"}
user> (seq (eduction (map inc) (range 10)))
(1 2 3 4 5 6 7 8 9 10)
> - There are lots of performance implications due to those changes and
> I would recommend re-testing any perf test related to sequence or
> eduction on alpha6 to get a fresh picture as anything pre-alpha6 is
> not comparable.
My observations are all based on today's experience with alpha6. :-)
> - eduction now takes multiple transformations, not just one, and
> composes them. This is designed for mechanical rewriting (hello tool
> developers!!) of ->> chains like this:
>
> (->> s (interpose 5) (partition-all 2))
>
> to this:
>
> (->> s (eduction (interpose 5) (partition-all 2)))
Ah, that's sensible.
> The general idea is that eduction is best when the result will be
> completely consumed in a reducible context. Any case of reusing the
> result will likely be better served by sequence which can cache and
> reuse the answer.
Yes, that's what I guessed. But at least when I tested replacing
sequence with eduction at exactly these places () the result has been a
slight slowdown instead of a speedup. But that might have been
accidental as it is hard to do measurements with real-world code where a
5% slowdown/speedup might be the reason of something completely
unrelated.
Bye,
Tassilo
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.