refactor: generic unbounded cache#701
Conversation
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
➖ Are we earthbuild yet?No change in "earthly" occurrences 📈 Overall Progress
Keep up the great work migrating from Earthly to Earthbuild! 🚀 💡 Tips for finding more occurrencesRun locally to see detailed breakdown: ./.github/scripts/count-earthly.shNote that the goal is not to reach 0. |
Signed-off-by: Giles Cope <gilescope@gmail.com>
|
@janishorsts have a look - it seemed there were a few holes (demonstrated by failing tests). I've patched them with claude's help and also switched from using sleeps to something more event based. (I try and avoid sleeps in tests wherever possible) |
Signed-off-by: Giles Cope <gilescope@gmail.com>
|
Feel free to roll back changes you don't like / reimplement! |
🛠️ Benefits, Issues Resolved & DX Impact
unbounded.Cache[K comparable, V any]), zero-allocation lookup on cache hit, and concurrent value construction coalescing.synccacheimplementation, eliminating heap boxing and runtimeinterface{}type assertion overhead.⚡ Performance Impact (
BenchmarkCache_Do_Hit)synccache)unbounded.Cache)48.20 ns/op16.54 ns/op-65.7%16 B/op0 B/op-100.0%1 allocs/op0 allocs/op-100.0%Benchmark Breakdown
BenchmarkCache_Do_Hit:16.54 ns/op|0 B/op|0 allocs/op(Sequential cache hit lookup)BenchmarkCache_Do_ConcurrentHits:136.40 ns/op|0 B/op|0 allocs/op(12-thread parallel cache hits)📦 Binary Size Impact
30.23 MB/30.28 MB/+48.4 KB(+0.16%)