Skip to content

Hardware-Aware Coding: CPU Architecture Concepts Every Developer Should Know

blog.codingconfessions.com
7 pointscodeman0011 comment
On HN

Comments

Profile to identify performance bottlenecks

I recall having the cache epiphany back in the day when I was profiling my app and it kept highling a section that used a lot of time for inconsequential work.

Took me some time before I realized that it was missing the cache ~100% of the time due to how it walked the data structure.

Also be aware of how things are profiled. Profilers that surround functions with stopwatches tend to inflate the cost of calling simple functions. I genrally prefer sampling profilers but they both have their pros and cons.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.