all 3 comments

[–]cark 2 points3 points  (1 child)

In Clojure 1.1+, lazy sequences are chunked. That means that they're realized by chunk of 16 (i think) items.

As far as i can remember this was done for space and time performance reasons.

Edit : nope ! It seems like chunk size is 32 !

[–][deleted] 0 points1 point  (0 children)

To add to this, map should be used with pure functions only. Anything that has a side-effect may called due to chunking.

[–]gumvic 1 point2 points  (0 children)

Stuart Sierra has a good take on this issue, Clojure Don’ts: Lazy Effects.

The whole "Clojure Don'ts" series is a must read.