Hacker News new | ask | show | jobs
by straight-shoota 633 days ago
I'm a core developer of Crystal. Looks like something went very wrong there. The GC may not be super optimised, but it's still practical. I have never heard about such drastic performance issues. And I'm aware of quite a few companies who use Crystal in heavy production loads for exactly the web server + db use case without such issue reports. So I'd suggest the root cause might be something else then the GC implementation.
1 comments

What is roughly the gc algorithm?
It is using Boehm/libgc. Just a simple webserver should not have the described behavior. The GC is not incremental though, so having a big heap would trigger it. But that is typically not the case for the described use case. Likely the issue is with doing something that involves more allocations than necessary.

There are works in libgc to allow incremental collection, but it is not yet ready for the needs of crystal (or at least it wasn't the last time I investigated).

Can crystal use a moving GC or does it suffer from the same issues python has with C FFI?

Also, is it possible to use RC with crystal?

Yeah moving objects would invalidate pointers passed to external code that's not controlled by Crystal.