# Why a Loop That Does 6% of the Work Takes the Same Time

Original title: Gallery of Processor Cache Effects

> Hacker News story 49956219 · language: en · submitted 2026-10-04
> Web version: https://zeli.app/story/49956219
> About this feed: https://zeli.app/llms.txt · Agent guide: https://zeli.app/skill.md

▲ 50 · by [porridgeraisin](<https://news.ycombinator.com/user?id=porridgeraisin>) · 💬 5
[original](<https://igoro.com/archive/gallery-of-processor-cache-effects/>) · [HN discussion](<https://news.ycombinator.com/item?id=49956219>)

## Summary

Igor Ostrovsky uses C# code samples to reveal how processor caches shape real-world performance. A loop touching every 16th array element runs as fast as one touching every element because both fetch the same 64-byte cache lines. He also shows how L1/L2 cache sizes create performance cliffs, how instruction-level parallelism can double loop speed, and how cache associativity causes mysterious slowdowns for certain step sizes.

## Key quote

> The second loop only does about 6% of the work of the first loop, but on modern machines, the two for-loops take about the same time: 80 and 78ms respectively on my machine.

## HN discussion (5 comments)

### [cowlevel](<https://news.ycombinator.com/item?id=49991057>)

> Website got slashdotted and hit its bandwidth limit

### [sapper123](<https://news.ycombinator.com/item?id=49990665>)

> This article is from 2010. That should be in the title.

---

## Cite

- Page: https://zeli.app/story/49956219
- Date: 2026-10-04
- Source: igoro.com (https://igoro.com/archive/gallery-of-processor-cache-effects/)
- Hacker News: https://news.ycombinator.com/item?id=49956219

## Other languages

- zh: https://zeli.app/zh/story/49956219 · markdown: https://zeli.app/zh/story/49956219.md
- ja: https://zeli.app/ja/story/49956219 · markdown: https://zeli.app/ja/story/49956219.md
- ko: https://zeli.app/ko/story/49956219 · markdown: https://zeli.app/ko/story/49956219.md
- de: https://zeli.app/de/story/49956219 · markdown: https://zeli.app/de/story/49956219.md
- es: https://zeli.app/es/story/49956219 · markdown: https://zeli.app/es/story/49956219.md
- ru: https://zeli.app/ru/story/49956219 · markdown: https://zeli.app/ru/story/49956219.md
