Re:Generics can make your Go code slower
by emtel on Wednesday March 30, 2022 @04:34PM
(#30860446)
I don't know anything about BEAM, but I don't think single-threading of any form really addresses the underlying problem. If you go to allocate something, and the system decides a GC is necessary in order to satisfy your allocation, then the GC has to run before your allocation returns.
[ Parent
| on HN ]
Re:Generics can make your Go code slower
by rbranson on Wednesday March 30, 2022 @06:42PM
(#30861747)
You can't share objects across threads (called "processes") in BEAM, so it's very different. The GC only ever needs to pause one call stack at a time to do a full GC cycle. Memory shared across processes is generally manually managed, typically more akin to a database than an object heap.
Re:Generics can make your Go code slower
by imtringued on Thursday March 31, 2022 @04:52AM
(#30865159)
>If you go to allocate something, and the system decides a GC is necessary in order to satisfy your allocation, then the GC has to run before your allocation returns.
Manual memory management on the heap does not solve this problem at all, it is actually worse at it than most traditional GCs. There is no magical system that allocates an object without executing code.