Monitoring OS Performance Counters
What can the OS tell us about the source of our read bandwidth discrepancy?
This is the third video in Part 3 of the Performance-Aware Programming series. Please see the Table of Contents to quickly navigate through the rest of the course as it is updated weekly. The listings referenced in the video (listings 106 and 107) are available on the github.
In the previous video, we discovered that our repetition tester was able to get much higher memory bandwidth than we were seeing in our actual application. Furthermore, it looked like there might be something suspicious going on the first time we tried to do a file read in an application.
Because we haven’t yet learned much about memory subsystems and file subsystems, it's hard for us to really guess what might be going on here. So what I'd like to do is put ourselves in the position of not really having a great idea of what might be causing this problem, so we can go through what we might do to track it down.
Of course, I could just tell you what the answer is, but that would only help solve this one specific problem. What we'd rather know is how to approach these kinds of problems more broadly? How do we expand our knowledge set and know what we don't know? How do we figure out what there is that we're missing so that we know to go read about it or to go learn about it? That's a very important skill to have, because there are always new things being added all the time to the tech stack, whether it's new CPU things or new storage things or new OS things, etc.
Let’s start with what we know.