Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lru: swap linked-list and map fields
The Garbage-Collector enqueues objects to scan to a work-queue in-order. Place the map before the LRU-stack linked-list so it has an extra head-start on scanning the much more efficient-to-scan datastructure (the map). The GC's mark-phase's traversal of the linked-list is a bit expensive because it'll have to jump one link at a time, enqueuing the next and/or previous pointers. By traversing the map first, a pseudo-random assortment of entry-points are used, rather than just the first and last. If large-ish (where we actually care) the map will be broken up into a number of pieces for scanning, so the first chunk will be scanned; enqueuing those linked-list elements before the head and tail get scanned. This swap will only have a modest effect because the map is already scanned, but hopefully we can reduce the recursion-depth by one. (We'll have to switch to something more CLOCK-ish without a linked-list to be GC-friendly; this change is just making the LRU modestly less GC-hostile)
- Loading branch information