feat: Make NormalizedPath interning cache configurable#343
feat: Make NormalizedPath interning cache configurable#343nielsenko merged 2 commits intoserverpod:mainfrom
Conversation
Introduce abstract Cache<K, V> interface with LruCache and NoCache implementations. NormalizedPath.interned can now be swapped to tune caching strategy for different workloads. Fixes serverpod#342, fixes serverpod#118
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (7)
📝 WalkthroughWalkthroughThis PR introduces a pluggable caching abstraction for the NormalizedPath interning mechanism. It defines a Cache interface, implements a NoCache no-op strategy, updates LruCache to conform to the interface, and refactors NormalizedPath to use Cache as the interned field type. The changes allow runtime substitution of caching implementations to address high-cardinality path performance cliffs. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@CodeRabbit review |
✅ Actions performedReview triggered.
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #343 +/- ##
==========================================
+ Coverage 91.20% 91.21% +0.01%
==========================================
Files 97 98 +1
Lines 3844 3849 +5
Branches 1960 1964 +4
==========================================
+ Hits 3506 3511 +5
Misses 338 338
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
While this makes caching configurable, we should investigate if we can make no-interning even cheaper. Dart side caches cannot be shared across isolates, which makes them less useful in multi-isolate deployments. @CodeRabbit Please create a follow-up issue. |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: Length of output: 45
🧠 Learnings used |

Introduce abstract Cache<K, V> interface with LruCache and NoCache implementations. NormalizedPath.interned can now be swapped to tune caching strategy for different workloads.
Fixes #342, fixes #118
Summary by CodeRabbit
Release Notes
New Features
Tests