Announcement

Collapse
No announcement yet.

VTune -- Is your application really doing what you think?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • VTune -- Is your application really doing what you think?

    With all of the commotion surrounding performance of the game, I want to suggest a utility that I have used that might be useful in analyzing this. Intel makes a product called VTune that can be used to analyze and tune applications and device drivers. There are some other programs that are more specific to application code, but VTune also covers device drivers as well.

    In its simplest incarnation, you run VTune alongside your application (you don't have to change your code), and it uses a Pentium feature to get interrupts every so often, logs the PC at that time, and continues. Running for a length of time provides you a map of where the "hot spots" in your code are, that might be good candidates for optimization. I understand that your application is designed to run at 100% CPU when available, but VTune would allow you to check that you are spending the time where you think you are. It sorts this by module, and you can "drill" into each module to the most expensive routines, etc. down to which line of code (assuming you have source) and which machine instruction is taking the most time.

    VTune can measure heuristically based on time, or based on unaligned memory accesses to check for structure alignment issues, or based on cache misses to check for data access issues, or any number of more obscure parameters. If you want to compile it into your code, it can also generate call trees and very accurate time measurements routine by routine.

    No, I do not work for Intel. I have merely used this utility often in optimizing device drivers. I thought since a lot of the issue may be centered around the graphics packages and device drives as well as your application code, that VTune might be useful place to start. You can download a demo version from the Intel web site that will print out the graphs but not save the data, to see if you like what it can do.

    Hope that helps. I am a developer as well, and I understand the frustrations of trying to develop something this complicated, especially in a Windows environment where you are at the mercy of everyone else's drivers and hardware. I very much enjoy the Civ programs, and while I am getting occasional crashes with Civ IV, I am having a great time with it as well. Thank you for all of your hard work.
Working...
X