Back of the envelope meaning that you thought about the implementation and
are estimating, or you have measurements?

Either way, I agree that there are definitely use cases where non-lazy
processing can give performance improvements.  Probably even relatively
common use cases.

Cases where lazy sequences have advantages (not intended to be an
exhaustive list):

+ if you determine that you do not need the whole sequence, portions of it
need not be generated at all (perhaps large portions)

+ I do not have measurements for this use case to quantify the potential
performance benefits, but if you have a 'pipeline' of lazy operations, e.g.
a map on function f1 whose result is fed into a map on function f2, then a
filter on function f3, etc., the time order of execution will typically
have f1 called on an item in the sequence, then f2, then f3, etc., and only
after that is done will you go back and call f1, f2, f3, ... on the next
item of the original sequence.  There can be performance benefits from
keeping those intermediate results in a processor's cache while doing f1,
f2, f3, etc., rather than a whole pass of applying f1, then going back to
the beginning and doing a whole pass of f2, etc.  This is primarily an
issue with sequences that are large enough that they do not fit into the
cache.

Andy



On Tue, Apr 1, 2014 at 11:19 AM, Pradip Caulagi <pra...@wwstay.com> wrote:

> I am just a newbie who has been hanging around and it is rather late in
> the day to bring this up but...
>
> should we remove lazy sequences and lazy evaluation from Clojure?  Back of
> the envelope calculations show that we can get 2x performance improvements.
>
> Thanks,
> Pradip
>
> --
> 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.
>

-- 
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.

Reply via email to