算法与计算机科学en.algorithmica.org编辑精选
面向现代硬件的算法
Algorithms for Modern Hardware
2022 — 2024,它一次次回到首页
黑点是上首页(≥ 50 分)的那次投稿,空心点是没冲上去的投稿,点越大分数越高。
导读
Algorithmica 的《Algorithms for Modern Hardware》是一本免费在线教程,讲解如何为现代硬件编写高性能代码,涵盖 CPU 架构、缓存、SIMD 等底层优化主题。它曾于 2022 和 2024 两次登上 Hacker News 首页,是性能优化领域广受认可的参考资料。
为什么经久不衰:它系统地把算法与真实硬件特性(缓存、对齐、SIMD 等)结合起来讲,内容免费且持续更新,是少有的兼顾理论与实践的性能优化教材。
HN 评论精选
推荐同领域的其他优化资源,并指出这类深度性能优化书籍受众很小。
这些主题太让人兴奋了,迫不及待想深入读这本书。如果你喜欢它,可能也会喜欢 Mike Acton 的数据导向编程优化技巧,以及 Pierre Terdiman 关于碰撞检测和物理优化的文章。我们几年前也写过一本书(和 SIGGRAPH 课程)《Multithreading for Visual Effects》,但这类书的受众其实相当小。
erwincoumans查看英文原文
Very exciting topics, can't wait digging into the book. If you like this, you might also enjoy reading about optimisation tips by Mike Acton (data oriented programming,https://dataorientedprogramming.wordpress.com/tag/mike-acton/ ) and Pierre Terdiman (on collision detection and physics optimizations, for example http://www.codercorner.com/blog/?p=1978) We wrote some book (and SIGGRAPH courses) a few years ago, Multithreading for Visual Effects (http://www.multithreadingandvfx.org). The audience for this kind of books turned out to be pretty small.
推荐搭配 Casey Muratori 的性能优化讲座一起学习。
来得正是时候!我刚看完 Casey Muratori 的讲座《Simple Code, High Performance》及其后续视频,强烈推荐。它讲的是软件优化,对 CPU 架构、SIMD 等主题给出了实用且高层次的理解。
mrv_asura查看英文原文
The timing of this is great! I just watched Casey Muratori's lecture, "Simple Code, High Performance"[1] and its follow-up videos[2, 3]. I highly recommend watching it. It is about Software Optimization, and gives practical and high-level understanding of topics like CPU Architecture, SIMD etc. [1]https://www.youtube.com/watch?v=Ge3aKEmZcqY [2]https://www.youtube.com/watch?v=8VakkEFOiJc [3]https://www.youtube.com/watch?v=1tEqsQ55-8I
指出剖析章节应补充代码/数据对齐变化导致的测量噪声问题。
我认为性能剖析(profiling)章节可以补充一类剖析噪声的内容:对代码的改动通常会改变代码和数据的对齐方式,这往往才是测得性能差异的原因,而非算法本身的改动。之所以算噪声,是因为无关的代码改动也可能再次改变对齐。演讲者建议改进编译器/剖析工具来随机化这些对齐并多次跑基准测试。
abainbridge查看英文原文
I think the profiling section could benefit from a section describing the sort of profiling noise described in this video: https://youtu.be/r-TLSBdHe1A?t=436 The noise source described is that changes to the code typically alter alignments of code and/or data and that is often the cause of the performance difference measured, not the change to the algorithm. The reason this is noise is because unrelated changes to the code might make it change again. IIRC, the speaker suggests improving compiler/profiler tools to randomise these alignments and benchmark many times.
历次讨论
同类还值得读
位运算技巧集
Bit Twiddling Hacks
斯坦福页面上的经典位运算技巧合集,收录了 popcount、前导/尾随零、位反转、交换、舍入等大量技巧,并附有解释和性能讨论。
算法与计算机科学上首页 8 次 · 2011–2024graphics.stanford.edu编辑精选如何不按平均评分排序
How Not To Sort By Average Rating
经典文章解释了为什么按平均评分排序不可靠:只有少量评价的条目(比如仅一条五星)会轻易排到最前,而评价数量的差异被忽略。
算法与计算机科学上首页 7 次 · 2009–2024evanmiller.org编辑精选数据结构可视化
Data Structure Visualizations
旧金山大学 David Galles 教授制作的数据结构与算法交互式可视化网站,涵盖 B 树、红黑树、排序、图算法等,可逐步操作观察其运行过程。
算法与计算机科学上首页 6 次 · 2011–2021cs.usfca.edu编辑精选1996 年以来的计算机科学最佳论文奖
Best Paper Awards in Computer Science since 1996
Jeff Huang 维护的一个汇总页面,收录了自 1996 年以来计算机科学各主要会议的“最佳论文奖”获奖名单,并按年份和会议整理,方便读者一站式浏览历届获奖论文。
算法与计算机科学上首页 6 次 · 2010–2018jeffhuang.com编辑精选算法(Jeff Erickson)
Algorithms, by Jeff Erickson
伊利诺伊大学 Jeff Erickson 教授的算法课教材,免费在线开放。
算法与计算机科学上首页 5 次 · 2018–2022jeffe.cs.illinois.edu编辑精选