feat(cache): add the arena-backed radix tree cache implementation #4878
feat(cache): add the arena-backed radix tree cache implementation #4878vedantdas-source wants to merge 5 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a custom radix tree implementation (arenaRadix) using a Left-Child Right-Sibling (LCRS) representation and 32-bit indices to minimize slice allocations and pointer overhead, along with comprehensive unit tests. The feedback is minor, pointing out a typo ('capcacity') in a panic message within the node allocation logic.
0936c46 to
5a03406
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## radix-trie-cache #4878 +/- ##
===================================================
Coverage ? 83.90%
===================================================
Files ? 172
Lines ? 21504
Branches ? 0
===================================================
Hits ? 18042
Misses ? 2788
Partials ? 674
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Please add the LRU implementation too in the same PR and ensure that the tests that pass with other LRU implementations pass with this one as well. |
5a03406 to
8ca36cc
Compare
Done. Added the functionality of the LRU operations as well as tests that the existing lru cache are tested against. |
8ca36cc to
b45c709
Compare
b45c709 to
cc83e4a
Compare
6aed5e0 to
5e37d3f
Compare
468be24 to
77ba07b
Compare
77ba07b to
2e4a631
Compare
Description
This PR introduces initial structure of the
arenaRadixcache.To reduce memory footprint and garbage collection overhead, this implementation moves away from traditional pointer-based nodes. Instead, it utilizes a Left-Child Right-Sibling (LCRS) representation backed by a slice-based arena allocator (
[]arenaRadixNode) and 32-bit indices.Changes made
arenaRadixNodeandarenaRadixcore structs.allocateNode,freeNode), entirely eliminating heap allocations during tree node creation.Link to the issue in case of a bug fix.
NA
Testing details
arena_radix_test.goto explicitly verify the internal tree mechanics and lru operationsAny backward incompatible change? If so, please explain.
None. This PR introduces new internal logic alongside the existing implementations and does not yet mutate any public package APIs or interfaces.