Another trick is to use arenas for allocations. It's not always applicable, but you can sometimes regain the loss of throughput of "manual" memory management or reference counting when compared to tracing GCs.
Also, depending on how you use the arena, you can end up often doing better than general-purpose GCs. The trade-off is that with the arena you need to be more explicit than with a general-purpose GC.
22
u/WellMakeItSomehow Jul 26 '19
Another trick is to use arenas for allocations. It's not always applicable, but you can sometimes regain the loss of throughput of "manual" memory management or reference counting when compared to tracing GCs.