frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Saving 100 terabytes of memory by optimizing 1.1.1.1's DNS cache

https://blog.cloudflare.com/dns-cache-memory-optimization-1111/
108•TangerineDream•1h ago•27 comments

507 Mechanical Movements

https://507movements.com/
318•helloplanets•4h ago•42 comments

Small Models Have Arrived

https://calv.info/small-models-have-arrived
159•tosh•2h ago•63 comments

Decompiling a Nintendo 64 game in 84 days

https://blog.chrislewis.au/decompiling-a-nintendo-64-game-in-84-days/
79•knackers•3h ago•20 comments

Suica, Japan's First IC Transit Card

https://www.tokyodev.com/articles/the-story-of-suica
73•zdw•2h ago•58 comments

Microduck

https://pollen-robotics.com/microduck/
353•robotswantdata•7h ago•137 comments

Emacs 31: An unofficial guide to Markdown-ts-mode

https://rahuljuliato.com/posts/markdown-ts-mode-emacs-31
118•RahulMJ•5h ago•46 comments

Launching Route 53 Files

https://www.daemonology.net/blog/2026-08-27-Launching-Route-53-Files.html
58•louis-paul•3h ago•19 comments

Bild AI (YC W25) is hiring product and AI engineers

https://www.bild.ai/jobs
1•rooppal•1h ago

We found a division by zero bug in FFmpeg with a vibecoded fuzzer

https://code.ffmpeg.org/FFmpeg/FFmpeg/issues/24290
6•dclavijo•38m ago•4 comments

Gemini Omni 1.1 Flash

https://blog.google/innovation-and-ai/technology/developers-tools/build-with-gemini-omni-1-1-flash/
14•saretup•1h ago•0 comments

M5Stack Launches PaperMono

https://shop.m5stack.com/blogs/news/m5stack-launches-papermono-a-compact-e-ink-development-termin...
5•marksully•41m ago•1 comments

Launch HN: Salem Robotics (YC S26) – Software for industrial inspection robots

25•Salem_robotics•2h ago•16 comments

The turbulent AI era is here

https://www.gatesnotes.com/work/make-ai-work-for-everyone/reader/a-turbulent-ai-era-and-critical-...
56•nanna•1d ago•302 comments

Nvidia agrees to acquire Hugging Face for $13B

https://www.businessinsider.com/nvidia-in-talks-to-buy-hugging-face-13-billion-dollars-2026-8
1730•mfiguiere•17h ago•808 comments

Why HPSC Is a Big Deal for Space Exploration

https://www.windriver.com/blog/Why-HPSC-Is-a-Big-Deal-for-Space-Exploration
18•mooreds•2h ago•4 comments

I measured what my Claude.md, skills and hooks are worth

https://github.com/jameskomo/config-drift-checker
3•smartwordworld•19m ago•0 comments

Aphantasia Beginner's Guide

https://aphantasia.com/guide
59•ksec•5h ago•139 comments

Show HN: The load-bearing vocabulary of Claude

https://louisabraham.github.io/load-bearing/
148•Labo333•9h ago•75 comments

A curmudgeon tries a language server

https://entropicthoughts.com/curmudgeon-tries-language-server
87•crescit_eundo•1d ago•53 comments

Engineered yeast for converting plastic and biomass compounds into food

https://acs.digitellinc.com/live/37/session/586399
23•ehwa37•2h ago•21 comments

Two German airport workers die of malaria after 'mosquito arrives on plane'

https://www.bbc.com/news/articles/cz6zwgg9y8go
76•vinni2•58m ago•34 comments

MIT's Ad Hoc Committee on AI Use in Teaching, Learning, and Research Training

https://aiandeducation.mit.edu/report/
76•pbui•5h ago•54 comments

Trade (and Tariffs)

https://xkcd.com/3290/
317•throw0101d•4h ago•119 comments

Show HN: My Claude quota ran out in 10 minutes, so I made a tool to find out why

https://github.com/kelviq/tare
43•sachinneravath•1h ago•33 comments

Show HN: Restoredrill – proves your Postgres backups restore

https://github.com/ahmadpiran/restoredrill
31•ahmadpiran•4h ago•11 comments

Humanity has the debate about AI consciousness backwards

https://economist.com/by-invitation/2026/08/20/humanity-has-the-debate-about-ai-consciousness-bac...
40•semiquaver•15h ago•109 comments

Show HN: A lightweight, stateless database for agent memory

https://polign.com/blog-edge-agent-memory
11•anuptalwalkar•1d ago•5 comments

Show HN: Yet another minimal and lightweight terminal multiplexer written in Go.

https://github.com/patriceckhart/hrdx
9•patriceckhart•47m ago•0 comments

CoMaps integration with the wider FLOSS ecosystem

https://www.comaps.app/news/2026-08-23/comaps-integration-with-the-wider-floss-ecosystem/
114•janandonly•5h ago•18 comments
Open in hackernews

Saving 100 terabytes of memory by optimizing 1.1.1.1's DNS cache

https://blog.cloudflare.com/dns-cache-memory-optimization-1111/
100•TangerineDream•1h ago

Comments

eviks•54m ago
> Once we store a DNS response in the cache, however, we never modify it again. The capacity field serves no purpose, but still costs 8 bytes per Vec

Were there no design discussions/reviews when the system was setup to catch trivial things like this?

micromacrofoot•53m ago
it was working so no one thought to check
mhitza•50m ago
Premature optimization argument fits right in. Now that memory is up to 10x more expensive it is worth considering optimizing programs with large memory footprint.
eviks•47m ago
How does that fit? What would be the evil of not wasting memory for many years at 1x?
jgrahamc•44m ago
One of the "evils" of premature optimization is how much time you spend on the optimization vs. the benefit you get from it. If your goal is correctness and shipping fast and you're not memory constrained then spending time using the least amount of memory is a waste of time specifically because you want to ship fast.

Another interesting thing that happens is you don't necessarily know what form your actual optimizations will need to take. Later when your systems grow you discover the suboptimal parts you hadn't optimized for.

Very early on at Cloudflare I worked on part of the DNS infrastructure that took DNS records from the UI and got them in a state for actual authoritative serving. The system had been constructed anticipating Cloudflare having millions of customers with unique domains, but it had not been constructed for a single customer with a single domain with millions of records. This caused a periodic slow down in DNS record updating while the system churned on that one customer.

In a different job I worked on a piece of optimization software that needed to keep track of "node" A is reachable from node "B". This had been implemented as a matrix (literally a malloced NxN matrix of ints storing 0 or 1) which worked really well for small systems. But you'd be out of memory really fast on a large project. I replaced the matrix with a hash table and all was good because the matrix was actually really sparse.

stickfigure•33m ago
Absolutely true, but I will say that LLMs have changed the equation somewhat.

With a rather short prompt, claude/codex will take your code, write a harness, profile it, build experiments, profile those, and give some pretty solid advice which one to pick. It's the kind of goal-directed, bite-sized job that LLMs excel at. Extremely low-commitment.

Except for the whole "making changes in production at scale" problem, of course.

gbear605•44m ago
Engineers are expensive, especially good system engineers who are trained in your code base. Very possible that this just hadn't gotten to the top of the priority list.
toast0•31m ago
Using obviously better data structures the first time isn't premature optimization.
mannyv•25m ago
There was a reason for that field, but that reason never panned out.
eviks•22m ago
Could you point to that reason?
lbriner•50m ago
It is often not worth optimising in the early days. You don't know how popular it will become, you might not know how many DNS records you will hold, it was possibly written in an earlier language and ported as-is.

At the point someone queries the 100TB of RAM, then maybe it is worth revisiting but even that has risks. You have to design the migration path, have fallback mechanisms etc.

eviks•39m ago
It's also often that you can avoid all those future migration/fallback risks and pains if you invest a little bit of design thinking upfront.

So how would you decide which path to take in situations like this?

suriyaG•24m ago
It only looks super obvious in hindsight and the well explained blog post. when a team of 5 is tasked with getting a completely new DNS up at the scale and integrate well with cloudflare.

if you spend cycles on nitty gritty opinions like this time to market goes out further and further out. some napkin math, 130 gen13 servers cost "only" ~$2.6M. relative to the importance of the 1.1.1.1 and the market at the time. that is nothing to cloudflare.

this is not to say good system design does not matter. it very much does, but making that call at that time would've butchered the prodcut very much similar to google+, youtube etc.

irdc•51m ago
This is why system programming still matters.

Looks like they're missing the obvious optimisation of putting the record data right after the CacheEntry members instead of allocating memory separately though. But that might just be me as a C-programmer talking and not be all that easy in Rust.

mkeeter•40m ago
For the curious, this is technically possible in Rust using a dynamically sized type [1], but in practice is difficult and doesn't really play nice with the rest of the language. The nomicon entry concludes with "Yes, custom DSTs are a largely half-baked feature for now." [2]

[1] https://doc.rust-lang.org/reference/dynamically-sized-types....

[2] https://doc.rust-lang.org/nomicon/exotic-sizes.html

cobalt•34m ago
less ergonomic, but still totally doable
sdcfgy•10m ago
System programming always matters. Things are cheap until they aren't one day.
strenholme•36m ago
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...

OptionOfT•31m ago
> we store the records as a single Box<[u8]> containing each record encoded as a 2-byte length prefix followed by its raw bytes.

Interestingly this is exactly how netlink works-ish: https://manpages.ubuntu.com/manpages/focal/man3/netlink.3.ht...

You start, get the type & length, and then that is how many bytes you read.

Some issues with that when you deserialize, from a raw stream in to `[u8; 4096]` buffer, the alignment is only guaranteed to be on 1 byte, not 4 bytes.

In practice it is 4 bytes, but if you run those tests with Miri, you'll get yelled at. So the fix there is to declare the buffer with a type that mandates the alignment of the largest type that you're going to be deserializing.

So then you start your buffer as follows: `[u32; 1024]`, and with `slice::from_raw_parts` you get to turn that into `[u8; 4096]` with the expected alignment.

As an exercise I wrote a streaming parser for netlink, the current existing package serializes everything, all at once.

mannyv•18m ago
One question the article doesn't answer is: why are they cacheing at all? If your cache is that big it isn't a cache. How much bigger is the dataset in question? There are 250 billion entries. Assuming 80/20, that implies 1.25 trillion records?

What's the speed of service/response time relative to the data source?

At that point it might be enough to replace your multiple caches with fewer in-RAM databases?

It's an interesting problem.

bastawhiz•16m ago
Maybe I'm misunderstanding, but this powers 1.1.1.1, it doesn't front an internal dataset. A cache miss hits a nameserver. Which is to say, the dataset is "every DNS record in the world"
eggnet•15m ago
They’re adding the cache consumed across all of their servers. It’s not one giant deep cache.
dshat•11m ago
I'll buys some spare RAM you now have. I only need 64GB.
eviks•34m ago
I don't understand why you need training on your code base to design a cache format for read only vs rw workloads, but anyway yours is a comment about neglect, not the "evil" that would happen if you did that design
win311fwg•28m ago
> I don't understand why you need training on your code base to design a cache format

Because anyone willing to come in just to design your cache format is going to expect payment that is many multiples more than the engineers you already cannot afford? Long-term employees cost less, which brings them closer to being affordable, but you have to be able to keep them busy for long periods of time to realize that reduction in cost. A engineer who doesn't understand your codebase isn't going to be useful for very long.

eviks•18m ago
You explained why it's beneficial for other workloads, but the original point was about this specific design