Creating an unlabeled list in clojure

I recently noticed that there was a very clear implementation of the insert:

stack overflow

  • which suffers from memory overflow due to concat lazily grouping. It was interesting to me:

What strategies can we apply to โ€œde-crawlingโ€ the list when we want to improve performance in large collections?

+6
source share
1 answer

doall is definitely great for lazy pricing.

Another useful thing to keep in mind is that reduce is not lazy. Therefore, this can be very useful in large calculations to ensure that intermediate results are evaluated and reduced to a single output before the calculation continues.

+5
source

Source: https://habr.com/ru/post/911627/


All Articles