That's why I still think that in this particular case, there is no new sequence creation (by fluokitten). yes, it does call first/next but those do not require (significant) new memory or copying. They reuse the memory of the underlying vectors, if I understood that well. Or there is something else that you referred to, Tim?
Additional note is that it is the current implementation. If someone points me to a better way to implement this case, I'll improve it. The API would stay the same. foldmap, in any case, is more general than this use case, and also does the folding (which is unneeded here, but very useful in general). And, as Francis said, if the priority is speed, I would use Neanderthal here, or maybe even ClojureCL if side effects are also numerical and there is enough data that GPU or CPU vectorization can make a difference. On Saturday, September 24, 2016, Alex Miller <a...@puredanger.com> wrote: > Just a general note of caution. range is a highly specialized (and > optimized) impl for both reducing and seq traversal. Also note that seqs on > vecs are about the next-most optimized seq (because they also don't > allocate or cache - rather they just pull from the vector nodes as the > backing store for elements). So just be cautious about making general > conclusions about reduce and seq performance from these two specific cases. > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to clojure@googlegroups.com > <javascript:_e(%7B%7D,'cvml','clojure@googlegroups.com');> > Note that posts from new members are moderated - please be patient with > your first post. > To unsubscribe from this group, send email to > clojure+unsubscr...@googlegroups.com > <javascript:_e(%7B%7D,'cvml','clojure%2bunsubscr...@googlegroups.com');> > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en > --- > You received this message because you are subscribed to a topic in the > Google Groups "Clojure" group. > To unsubscribe from this topic, visit https://groups.google.com/d/ > topic/clojure/Q5uZcYRdbgg/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > clojure+unsubscr...@googlegroups.com > <javascript:_e(%7B%7D,'cvml','clojure%2bunsubscr...@googlegroups.com');>. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com 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 clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.