Reading and writing are less symmetric than you (probably) think
luu
135 points
30 comments
October 28, 2026
Related Discussions
Found 5 related stories in 38.7ms across 3,874 title embeddings via pgvector HNSW
- Writing Is Closer to Thought Than Code eigenBasis · 73 pts · October 26, 2026 · 53% similar
- Writing as a thinking tool jruohonen · 320 pts · November 08, 2026 · 48% similar
- Scattered thoughts on how doing math feels these days surprisetalk · 72 pts · October 26, 2026 · 46% similar
- The 'Astra can read and write weights to improve Qwen' post is misleading syllogism · 948 pts · November 03, 2026 · 45% similar
- Writing correct software is hard and math alone won’t help us (2016) AriFordsham · 361 pts · November 12, 2026 · 45% similar
Discussion Highlights (10 comments)
vatsachak
This is true even at the CPU cache level so it's probably going to trickle down all the way. For example Jon G gave a talk at Jane Street about how he had a mysterious performance bug that was later attributed to cores fighting over the same cache line https://youtu.be/tND-wBBZ8RY?is=624w3YoDN2QYBWuD
1317
oh i thought this would be about language and how the brain works, that article sounds more interesting to be honest sorry
tbrownaw
Yep, reading something doesn't invalidate your caches. Or everyone else's caches.
mightyham
> the data may have made it to storage, but that doesn’t necessarily mean it’s actually visible, because the metadata necessary to reach it might not have been written yet. The author should clarify here that this fsync wrinkle only affects newly created files, not updates to existing ones.
rwmj
In any discussion of read, write & sync, I'd want to talk about write amplification (read/modify/write cycles), and also in Linux the sync_file_range syscall which is a useful way to sync part of a file.
Pannoniae
Great article :D The rabbithole actually goes even deeper because buffering on the read side is almost always good, but reads are often way more latency-sensitive than writes. Which leads to the paradox that increasing the buffer size / prefetching more with mmapping can lead to worse performance due to the added latency. And decreasing the buffer size can have the same effect due to issuing more calls, so in order to squeeze in the optimal throughput/latency ratio on reads you have to tune it per workload.... or just try a few different buffer sizes and see which one works better. Writes are the opposite, they're usually not RAW (read-after-write), they're "fire and forget", so you don't really care about latency, but you do care a whole a lot about your writes actually arriving... again two competing parameters because the more you batch the writes, the faster they are but the bigger chance of a torn write or data loss. And unlike reads, writes are not idempotent on the application level so ideally you'd want some logic to atomically write a meaningful amount of data so it won't get torn, even if it crashes. Now in practice just about no one actually does any of this but it's a fun thought :D
cryptonector
I was hoping for something about human reading and writing, but it was about POSIX I/O APIs. Not bad, and I'd go further and point out that `mmap()` is good for reading but not for writing, and why.
zokier
There is plenty of fun to be had with write errors and fsync. One example was so called "fsyncgate" where postgresql stumbled upon fsync issues: https://news.ycombinator.com/item?id=20491965 I think there were some changes in kernel since that but I can't remember what exactly
zahlman
(2015) I don't know why I'd "(probably) think" they're anything like symmetrical. After all, I have first-hand experience of reading code and writing code; clearly, very different processes.
6LLvveMx2koXfwn
I was thinking 'brains'; you read something, well, ok, you write something, Boom that thing is sticking!