5 ms·
I haven't looked in a while, so I'm wondering what SBCL's GC latency profile is like nowadays. IIRC, it used to be a non-incremental STW conservative GC, which
by dmpk2k 3y ago
I haven't looked in a while, so I'm wondering what SBCL's GC latency profile is like nowadays. IIRC, it used to be a non-incremental STW conservative GC, which is a bit unfortunate.
- jjtheblunt 3y agoThis might align with your interest, from 2023. https://applied-langua.ge/~hayley/swcl-gc.pdf https://applied-langua.ge/~hayley/swcl-gc.pdf
- dmpk2k 3y agoThank you!
- nickpsecurity 3y agoWhich is itself based on Immix which was really neat: https://www.cs.cornell.edu/courses/cs6120/2019fa/blog/immix/ https://www.cs.cornell.edu/courses/cs6120/2019fa/blog/immix/
- jjtheblunt 3y agoCool!
- vindarel 3y agoIt's at least good enough to release a game on Steam. Here's an experience report: https://raw.githubusercontent.com/Shinmera/talks/master/els2023-kandria/paper.pdf https://raw.githubusercontent.com/Shinmera/talks/master/els2... (https://kandria.com/ https://kandria.com/) > Overall we have needed to do surprisingly little actual performance analysis and optimisation work to make Kandria run well. This is definitely in large part thanks to SBCL’s quite good native code compiler and type inference systems, and the prior work we’ve done to design critical libraries to not be completely obscene in terms of their performance characteristics. > […]
- Archit3ch 3y agoFollow-up question: is there a way to "freeze" the GC? As in, I've done all my allocations, now I want to run a main loop uninterrupted, and force clean up inside at_exit().
- phoe-krk 3y agoTry setting or binding SB-KERNEL:*GC-INHIBIT* to true.
- stassats 3y agoThat's a recipe for disaster. Never do that.
- phoe-krk 3y agoDamn, I searched the sources on GitHub for WITHOUT-GC but found nothing; I should have searched for SB-SYS:WITHOUT-GCING which is the actual user-facing interface. Thanks for the correction.
- stassats 3y agoSYS:WITHOUT-GCING is better but is still fraught with danger (that's why I didn't mention it).
- tmtvl 3y agoI think you'll want without-interrupts for that: https://sbcl.org/sbcl-internals/The-deferral-mechanism.html https://sbcl.org/sbcl-internals/The-deferral-mechanism.html
- stassats 3y agoThat's not related to garbage collection.
- moonchild 3y agoIf you're not allocating, the gc won't run anyway. If you made a mistake and are allocating where you don't want to be, a gc pause might be preferable to a crash.
- ravi-delia 3y agoI've found it to be pretty performant, but I rarely push it so who knows. SBCL is often good at avoiding allocations if you type hint things, which I'm usually doing when I need performance (messing around with sims mostly). But of course if you're doing unavoidably allocation-heavy work that doesn't do anything for you, so I'm not sure how much the gc hurts
- aidenn0 3y agoIt's also generational and moving, but other than that you're right. For anyone wondering how it can be conservative and moving, for values that may or may not be pointers, it treats the data as pinned. Originally CMUCL targeted RISC processors that had a lot of registers, so it maintained two stacks. X86 is extremely register starved, so the conservative GC was written. In practice, the conservative nature doesn't cause problems on 64 bit architectures.