今日已更新 213 条资讯 | 累计 20683 条内容
关于我们

Measuring cache misses on macOS with Instruments

/u/markuzo1 2026年06月24日 20:49 1 次阅读 来源:Reddit r/programming

I couldn't find many resources online that showed how to see cache misses on macOS. I thought I'd learn a bit about Instruments, throw some toy problems at it, and write about the experience in a blog post. These toy examples - iterating sequentially then randomly, summing elements in a matrix, naive vs tiled matmul and iterating AoS vs SoA - are great to see some real numbers from L1 data cache misses, but they're far away from real programming problems. What's your experience using tools like Instruments/perf/cachegrind to actually optimize an algorithm? Is it ever needed to measure this at the hardware counter level or can you get away with intuition about the size of your data structure, how it's been accessed and using basic timers? submitted by /u/markuzo1 [link] [留言]

本文内容来源于互联网,版权归原作者所有
查看原文