mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-07-23 21:23:06 +00:00
Add rtree lookup path caching.
rtree-based extent lookups remain more expensive than chunk-based run lookups, but with this optimization the fast path slowdown is ~3 CPU cycles per metadata lookup (on Intel Core i7-4980HQ), versus ~11 cycles prior. The path caching speedup tends to degrade gracefully unless allocated memory is spread far apart (as is the case when using a mixture of sbrk() and mmap()).
This commit is contained in:
@@ -52,11 +52,12 @@ rtree_new(rtree_t *rtree, unsigned bits)
|
||||
rtree->levels[height-1].cumbits = bits;
|
||||
}
|
||||
|
||||
/* Compute lookup table to be used by rtree_start_level(). */
|
||||
/* Compute lookup table to be used by rtree_[ctx_]start_level(). */
|
||||
for (i = 0; i < RTREE_HEIGHT_MAX; i++) {
|
||||
rtree->start_level[i] = hmin(RTREE_HEIGHT_MAX - 1 - i, height -
|
||||
1);
|
||||
}
|
||||
rtree->start_level[RTREE_HEIGHT_MAX] = 0;
|
||||
|
||||
return (false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user