snazzy-d/sdc

Add a thread cache for the GC's ExtentMap lookups

deadalnix opened this issue · 3 comments

It sounds like we are using a lookup to save a lookup which seems self defeating, however, we expect:

  1. The hit rate to be very high, as each entry maps 1GB of RAM.
  2. The thread cache to be hot - or at least in need to become so anyways, so we potentially save one miss.
  3. We can save TLB entries for the application.
  4. 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

Done in 08f0f11