We have talked at length about caches in this chapter, but is there a way to see how our application is performing in this sense? There actually is. It's called Cachegrind, and it's part of Valgrind. It's used in the same way as Callgrind, with cargo profiler. In the case of the same preceding application, the cargo profiler failed to parse Cachegrind's response, so I had to run Valgrind directly, as you can see in the following screenshot:
This was my second or third run, so some information might have already been cached. But still, as you can see, 2.1% of the first-level data cache missed, which is not so bad, given that the ...