# 别再数FLOPs，要数Bytes

Original title: Count the Bytes, Not the FLOPs

> Hacker News story 48907876 · language: zh · submitted 2026-07-14
> Web version: https://zeli.app/zh/story/48907876
> About this feed: https://zeli.app/llms.txt · Agent guide: https://zeli.app/skill.md

▲ 10 · by [sgilda](<https://news.ycombinator.com/user?id=sgilda>) · 💬 1
[original](<https://thepragmaticquant.com/why-we-stopped-materializing-arrays/>) · [HN discussion](<https://news.ycombinator.com/item?id=48907876>)

## Summary

我们在优化tsbootstrap时遭遇了一次惨痛失败：面对成熟的arch库，我们的批量处理方案在真实负载下慢了几倍。问题不在于Python解释器的开销，而在于我们盲目追求向量化，将数千个bootstrap replicate一次性构建为巨大的张量。这导致数据在内存和缓存间反复搬运，算术强度极低。我们最终悟出一个道理：不要为了计算而计算，要关注内存流量。通过改为流式处理，不再物化中间数组，我们不仅消除了不必要的内存峰值，更将性能提升了数倍。记住，在内存带宽受限的时代，数Bytes比数FLOPs更重要。

## Key quote

> 那个gather操作之所以慢，不是因为代码被解释执行，而是因为其算术强度太低，无法让处理器保持忙碌：这是一个Bytes问题，却被错误地当作FLOPs问题来对待。

---

## Cite

- Page: https://zeli.app/zh/story/48907876
- Date: 2026-07-14
- Source: thepragmaticquant.com (https://thepragmaticquant.com/why-we-stopped-materializing-arrays/)
- Hacker News: https://news.ycombinator.com/item?id=48907876

## Other languages

- en: https://zeli.app/story/48907876 · markdown: https://zeli.app/story/48907876.md
- ja: https://zeli.app/ja/story/48907876 · markdown: https://zeli.app/ja/story/48907876.md
- ko: https://zeli.app/ko/story/48907876 · markdown: https://zeli.app/ko/story/48907876.md
- de: https://zeli.app/de/story/48907876 · markdown: https://zeli.app/de/story/48907876.md
- es: https://zeli.app/es/story/48907876 · markdown: https://zeli.app/es/story/48907876.md
