Re: #{:eduction :performance} Trying to understand when to use eduction

2015-07-20 Thread Stuart Sierra
Thanks for the correction, Alex. On Sunday, July 19, 2015 at 12:34:37 PM UTC-4, Alex Miller wrote: > seqs on eductions *are* chunked - they will fall into this case during > seq: > https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/RT.java#L524-L525 > > which produces a chunk

Re: #{:eduction :performance} Trying to understand when to use eduction

2015-07-19 Thread Leon Grapenthin
Stuart and Alex, thank you for your replies and recommondations. I take it then that the problem is the seq casting performed in apply and in reduce1. For now the only way to avoid applys seq casting seems to be a hackish .doInvoke call. Kind regards, Leon. On Sunday, July 19, 2015 at 6:34

Re: #{:eduction :performance} Trying to understand when to use eduction

2015-07-19 Thread Alex Miller
On Sunday, July 19, 2015 at 10:53:25 AM UTC-5, Stuart Sierra wrote: > > Hi Leon, > > I think this is an edge case related to how varargs functions are > implemented in Clojure. > > The varargs arity of `max` is implemented with `reduce1`: core.clj line > 1088 >

Re: #{:eduction :performance} Trying to understand when to use eduction

2015-07-19 Thread Stuart Sierra
Hi Leon, I think this is an edge case related to how varargs functions are implemented in Clojure. The varargs arity of `max` is implemented with `reduce1`: core.clj line 1088 `red

#{:eduction :performance} Trying to understand when to use eduction

2015-07-18 Thread Leon Grapenthin
My understanding was that if I pass an eduction to a process using reduce, I can save the computer time and space because the per step overhead of lazy sequences is gone and also the entire sequence does not have to reside in memory at once. When I time the difference between (apply max (map in