Performance Analysis Tricks

This is a summary of many tricks I learned, a lot of them from Vladimir Kiriansky, my office mate. I write it to organize the things I learned.

  1. Interactive analysis
    1. Get some hardware counters running (perf with -I ), easiest way to get an idea what is going on. Especially useful when you only care about a part of the program
  2. Amplify certain portion of the program
    1. If you really care only about a few iterations of the program, repeat these iterations many times so that you can collect data on that. The question is what if these iterations modify the states? we do the following steps
      1. Need to have pre-Amplify code that copy all the states to old states
      2. post-Amplify
        1. code that restore the old states
        2. run it once more for real (this way the application logic stays the same)
  3. Adding program specific counters
    1. To understand the performance characteristics of a program, it is useful to add your own counters in the code, other than relying on the performance counters. For example, if you have a good way of showing branch rates, it would give you an idea how bad misprediction is.
  4. A good talk by Andi Kleen
This entry was posted in Tools, Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s