# Saving 100 terabytes of memory by optimizing 1.1.1.1's DNS cache
# 通过优化 1.1.1.1 的 DNS 缓存节省 100 TB 内存
440 points · 121 comments | 作者: TangerineDream | 原文: news.ycombinator.com
时间: 2026-08-27T17:17:57Z
### 热门评论
1. [strenholme]
> With my own MaraDNS, I aggressively optimized the memory usage of blacklist entries by having a single really big malloc() to allocate the memory for the entries, then traversing that memory block for potentially blacklisted entries.When I was using one malloc() per entry, a large blacklist took up 237 megabytes of memory. The same blacklist, once optimized to be loaded with a single malloc() call, only took up 9.5 megabytes of memory.https://samboy.github.io/blog/entries/MaraDNS.html#BlogEntry...
⋯ 继续阅读请开通会员 ⋯