Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

As someone learning Common Lisp for fun and planning to use it in the web, I’m a little disturbed by the “we manually force garbage collection periodically” part of that article. I haven’t fully digested the commentary, so maybe I’m more concerned than necessary…



Looks like they wanted to configure a much larger heap than they needed just in case, but then to have the system pretend it doesn't exist, and do GC cycles at a much lower threshold. I'm surprised SBCL doesn't have parameters to be just tuned that way; if not, that could be upstreamed.

Going longer between garbage collection cycles could be worse in terms of caching and paging. Marking the live objects allocated in that generation is about the same, since that doesn't grow, but there is more garbage to visit and sweep. Sweeping a smaller memory area more frequently is going to be faster than sweeping a larger area less frequently, from the point or view of caches and TLB.

(Regarding my remark about live objects; with larger collection cycles, they could be spread in a wider VM footprint, even if their quantity doesn't grow. The image has a kind of "GC working set"; longer intervals mean that there is a longer working set. The data being transformed cycles through more memory locations.)


> more concerned than necessary.

I would say so, specially when you plan to use it for web dev (welcome!). Shinmera has released a game in CL heavily depending on CLOS (object system), and he says the GC is barely a matter.

https://raw.githubusercontent.com/Shinmera/talks/master/els2...

https://kandria.com/ (https://github.com/Shirakumo/kandria)

https://reader.tymoon.eu/article/413


I recognize your user name. Great work on the Lisp Journey site! Several times I’ve had a question and then found the exact same thought expressed on your site (along with an answer).


That's nice to hear, thanks for the feedback. I've been puzzled many times when starting out (or taking a not-so crowded path), so I'm glad the ones after me are having a better time.

Now, your time to build cool things and share in the process ;)

---

(https://lisp-journey.gitlab.io/)




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: