3 ms·
> GC has a horrific overhead in the average program It doesn't have to be that way. The BEAM is designed for tiny processes, and GC is cheap.
by macintux 2y ago
> GC has a horrific overhead in the average program
It doesn't have to be that way. The BEAM is designed for tiny processes, and GC is cheap.
- toast0 2y agoI love Erlang and BEAM, but the reason the GC is (mostly) cheap is because self-referential data structures are impossible, so you can have a very simple and yet still very effective GC. One heap per process also helps immensely. Also, when your process has a giant heap, the GC gets expensive. There's been lots of improvement over the years, but I used to have processes that could usually go through N messages/sec, but if they ever got a backlog, the throughput would drop, and that would tend towards more backlog and even less throughput, and pretty soon it will never catch up. That sometimes happens with other GC systems, but it never feels quite so dire.