CPU Profiling: What, How, and When

March 10, 2025 · 881 words · 5 min · Performance Profiling

What: What is CPU Profiling

A technique for analyzing program CPU performance. By collecting detailed data during program execution (such as function call frequency, time consumption, call stacks, etc.), it helps developers identify performance bottlenecks and optimize code efficiency. Typically used in performance analysis and root cause diagnosis scenarios.

CPU False Sharing

May 2, 2021 · 566 words · 3 min · CPU Cache Performance

The motivation for this post comes from an interview question I was asked: What is CPU false sharing?

CPU Cache

Let’s start by discussing CPU cache.

CPU cache is a type of storage medium introduced to bridge the speed gap between the CPU and main memory. In the pyramid-shaped storage hierarchy, it is located just below CPU registers. Its capacity is much smaller than that of main memory, but its speed can be close to the processor’s frequency.