Add a thread cache for the GC's ExtentMap lookups
deadalnix opened this issue · 3 comments
deadalnix commented
It sounds like we are using a lookup to save a lookup which seems self defeating, however, we expect:
- The hit rate to be very high, as each entry maps 1GB of RAM.
- The thread cache to be hot - or at least in need to become so anyways, so we potentially save one miss.
- We can save TLB entries for the application.
- We won't run into false sharing when the heap grows.
The cache could be added there and passed down to any other function that would require it.
The behavior can be similar to jemalloc's rtree tsd:
https://github.com/jemalloc/jemalloc/blob/d577e9b5880906dbd4ab04fb61de5650170ac08b/include/jemalloc/internal/rtree_tsd.h#L4
https://github.com/jemalloc/jemalloc/blob/d577e9b5880906dbd4ab04fb61de5650170ac08b/src/rtree.c#L205-L231
deadalnix commented
deadalnix commented
We want the new cache to be added in https://github.com/snazzy-d/sdc/blob/master/sdlib/d/gc/tcache.d