Dropping eBPF CPU Cost by About 90% with Memoization (Not AI Gen)
nathannaveen
83 points
23 comments
September 14, 2026
Related Discussions
Found 5 related stories in 112.9ms across 6,607 title embeddings via pgvector HNSW
- How Do I Profile eBPF Code? snaveen · 114 pts · July 28, 2026 · 55% similar
- Show HN: Reame – a CPU inference server that gets faster as it runs targetbridge · 48 pts · July 11, 2026 · 51% similar
- Code mode yields a 99.2% cost reduction in our systems tarasyarema · 61 pts · July 23, 2026 · 50% similar
- I Cut 80%+ of Context Overhead in My Coding Agent asm3r96 · 12 pts · August 28, 2026 · 50% similar
- Reimplementing pf as an eBPF/XDP dataplane on Linux 882542F3884314B · 15 pts · July 11, 2026 · 48% similar
Discussion Highlights (10 comments)
mrbluecoat
So you highlight "Not AI Gen" but you call the solution "Agent"? :D
danudey
Very confused by the article. Is memoization new to the eBPF world? Did the author only just learn about it and wanted to use it? In reality, the article is about correctly caching a path:policy mapping while working within the limitations of eBPF and Linux filesystem semantics. If you read the article in that context rather than wondering 'what is new and interesting about memoization in eBPF?' it's a lot more interesting. I probably would have titled this 'Calculating cache keys for filesystem paths in eBPF' or something, since that's the cool and interesting problem that was solved.
asdfman123
I don't know what any of these acronyms mean. With just a little more explanation the article could be accessible to a wider developer audience.
bawolff
Umm, wouldn't this break if you moved a directory that is somewhere up the path? Seems like a security issue if you cache what policy applies but the policy could change by user action.
Allybag
Seems like the 90% faster case is opening the same exact file every single time, which seems like a not super standard use case that will benefit the most from this caching. On an example where you never open the same file twice this will presumably be slightly slower than before, as you’re doing the same thing but writing to a cache. So you can make the headline “Drop performance cost by 90%!” or “Modestly increase performance cost” and be correct but I don’t think either is really a reasonable description of the change.
ComputerGuru
How do your path-only rules handle the many approaches for loading a file but making it appear to have a different path, such as bind mounts for one example?
yxhuvud
And uh, what happens if the active user permission changes?
self_awareness
TL;DR - use in-memory cache instead of expensive database lookups on every iteration
brookman64k
How is the cache invalidated when: - The permissions change? - Directories are moved? - Hard-links are added? - Things are deleted? Also: Is the cache limited in size?
visarga
> Not AI Gen I am not sure how to react ... of course good thing it's human-gen, but I still like a few AI passes over it to tighten it up. LOL