系统与基础设施people.freebsd.org编辑精选
每个程序员都应该了解的内存知识
What Every Programmer Should Know About Memory (2007) [pdf]
2015 — 2022,它一次次回到首页
黑点是上首页(≥ 50 分)的那次投稿,空心点是没冲上去的投稿,点越大分数越高。
导读
《What Every Programmer Should Know About Memory》是 Ulrich Drepper 撰写的经典长文,系统讲解现代计算机的内存层次、CPU 缓存、DRAM 以及程序如何利用这些硬件特性。评论普遍认为开头的晶体管级内容可以跳过,真正实用的是从第 3 节 CPU 缓存开始的部分。它长期被视为系统性能与底层编程的重要参考。
为什么经久不衰:因为内存层次和缓存行为始终是性能的关键,本文把硬件细节与编程实践连在一起,多年后仍能帮助解释和优化真实程序。
HN 评论精选
建议跳过开头,从 CPU 缓存章节开始读。
这是一份极其有用的指南,但开头讲晶体管层面的内容,至少我觉得相关性小得多。精彩的部分从第 3 节 CPU 缓存开始。
kenferry查看英文原文
This is an incredibly useful guide, but it starts out with transistor level stuff that I at least find much less relevant. The good stuff starts at section 3, CPU Caches.
推荐 Dan Luu 关于现代 CPU 特性的配套文章。
这里有一篇很好的配套文章,重点讲 CPU 特性而非内存:“80 年代以来 CPU 有什么新变化,以及它如何影响程序员?”
lj3查看英文原文
Here's a good companion piece that focuses on CPU features rather than memory: "What's new in CPUs since the 80s and how does it affect programmers?"[0] [0]: https://danluu.com/new-cpu-features/
质疑普通程序员是否需掌握如此底层细节,认为编译器应负责。
这份文档很迷人,但认为每个程序员都需要熟悉电容时序才能高效使用 RAM,更别说写出有效程序,我觉得这太牵强。随着没有手动内存管理(MMM)的语言越来越流行,这些细节其实要靠编译器作者(至少其中一部分人)来正确处理。
fnovd查看英文原文
A fascinating document, but I find it far-fetched that every programmer needs be intimately familiar with capacitor timing to use RAM efficiently, let alone write efficacious programs. As languages without MMM become more popular, it's really up to the compiler authors (or at least a subset of them) to get all of these details right.
作者知名度很高,但英文维基条目被删除并禁止创建。
文章很有名,作者 Ulrich Drepper 也因 GNU C Library 的工作在 FOSS 界知名。我惊讶他没有英文维基页面(德、法、挪、日、波斯语都有),想翻译创建一个却无法创建,因为页面被保护;2014 年的删除讨论认为不符合人物关注度、可验证性和生者传记要求。
delhanty查看英文原文
(slightly) OT: The article is well known and the author Ulrich Drepper is also well known in the FOSS world for his work on the GNU C Library. [1] So I was surprised to find that he did not have a small English language Wikipedia page, even though there were pages in German, French, Norwegian, Japanese and Persian. Oh, "that can't be right - I'll create one!", I thought. (By translating one of the existing pages.) But I could not! The page "is protected from creation" [2]. An archived deletion discussion from 2014 states "This article fails Wikipedia:Notability (people), Wikipedia:Verifiability, and Wikipedia:Biographies of living persons and should be deleted." ... etc. Edit: s/Dropper/Drepper/ [1] https://en.wikipedia.org/wiki/GNU_C_Library [2] https://en.wikipedia.org/wiki/Ulrich_Drepper [3] https://en.wikipedia.org/wiki/Wikipedia:Articles_for_deletion/Ulrich_Drepper
历次讨论
同类还值得读
TTY 揭秘(2008)
The TTY demystified (2008)
经典文章深入剖析了 Unix/Linux 中 TTY 子系统的工作原理,包括线路规程、终端驱动、信号与控制字符等机制。
系统与基础设施上首页 11 次 · 2009–2025linusakesson.net编辑精选为什么 GNU grep 这么快
Why GNU grep is Fast
FreeBSD 邮件列表上一篇广为流传的帖子,解释 GNU grep 为什么快:核心在于 Boyer-Moore 字符串搜索算法配合精心优化的内部循环和 I/O,让程序在搜索时“…
系统与基础设施上首页 9 次 · 2010–2022lists.freebsd.orgXplain:为普通人讲解 X11
Xplain – Explaining X11 for the rest of us
《Xplain》是作者(HN 用户 Jasper_)写的一系列 X11 长文,用他在浏览器中重建的 X11 绘图模型做交互演示,讲解 X11 的绘图模型与窗口系统设计。
系统与基础设施上首页 6 次 · 2013–2020magcius.github.io编辑精选旋风教程:为 Linux 创建极小 ELF 可执行文件(1999)
A Whirlwind Tutorial on Creating Really Teensy ELF Executables for Linux (1999)
breadbox 写于 1999 年的经典教程,主题是如何为 Linux 手工构造并裁剪出体积极小的 ELF 可执行文件。
系统与基础设施上首页 6 次 · 2007–2025muppetlabs.comPostgreSQL 内部原理
The internals of PostgreSQL
《The Internals of PostgreSQL》是一本免费在线书籍,系统讲解 PostgreSQL 的内部实现,包括查询处理、并发控制、WAL、缓冲区管理等核心机制。
系统与基础设施上首页 5 次 · 2017–2025interdb.jp编辑精选