4 ms·
> While not always the case, it is often the case that a good GC will beat all of those. A generational copying GC with parallel collection will treat most allo
by littlestymaar 4y ago
> While not always the case, it is often the case that a good GC will beat all of those. A generational copying GC with parallel collection will treat most allocations as pointer bumps. Giving them the speed of a bump allocator with periodic fragmentation fixes when collection happens. It will beat both slab and arena allocators.
Wouldn't memory barrier add a significant overhead in this case? (compared to an arena not needing any memory synchronization at all if it's only needed on a single thread)
- cogman10 4y agoI'd give this article a read to understand how java gets around this problem. https://dzone.com/articles/thread-local-allocation-buffers https://dzone.com/articles/thread-local-allocation-buffers The short answer is that for java at least (and I suspect other GCs in other languages, but haven't confirmed) there's a thread local allocation buffer which is just the pointer bumps.
- littlestymaar 4y agoThanks, I'll read that.