On May 7, 9:26 am, Meikel Brandmeyer <m...@kotka.de> wrote:
> Hi,
>
> Am 07.05.2009 um 17:19 schrieb Bradbev:
>
> > This also leads me to think that it would be useful to have a function
> > that precached a lazy seq, ie
> > (pre-cache-seq 5 (range 1000)); returns a new lazy-seq that will keep
> > 5 elements ahead by precaching on another thread.
>
> Maybe clojure.core/seque might help you?
>
I didn't know about that function, and it does look exactly like what
I want.  Except that using it is slower :(

;;;; (time (dorun (map identity (read-lines "file")))
"Elapsed time: 673.319593 msecs"
user>
;;;; (time (dorun (map identity (seque (read-lines "file")))
"Elapsed time: 3959.109581 msecs"

Cheers,
Brad
--~--~---------~--~----~------------~-------~--~----~
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
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to