Profiling of CvGameCoreDLL

Terkhen

King
Joined
Aug 1, 2011
Messages
917
Location
Granada
I'm interested on profiling the CvGameCoreDLL included in mods to see what functions are called more often and check if it is possible to increase the performance of those bottlenecks a bit. I have some notions on profiling using Visual Studio, and I'm looking for something similar to what gprof does.

I don't know if it is possible at all to profile a part of a program (the core dll) when the program itself is not prepared for this kind of analysis (a standard BtS game). Anyone has managed to do something similar to this? I would appreciate being pointed in the right direction :)
 
I can't tell you how, but it has been done.

There are two main performance enhancing attempts for BtS that have resulted in mods:

StMartin (and the HoTK team) sped up the game by about 15% in the CAR mod. This mod has been in whole or in part added to many other mods since then (including Final Frontier Plus).

Sephi started with CAR and produced an even more extensive performance enhancement mod called BtS on Speed. Some mods are incorporating all, or parts, of this too (the most recent version of Final Frontier Plus added most of this).
 
I have used very Very Sleepy a couple of times, and it was simple and informative. Not the most feature-full profiler out there, and a very simplistic GUI (no graphs or anything), but it's free.
 
I have been profiling with Very Sleepy a bit. It works great, giving a lot of info :)

My problem now is comparing changes. If I optimize something, I need to measure time as exactly as possible between "normal" and "improved" CvGameCoreDLL. I started by opening Civilization IV, loading the savegame, opening the AIAutoPlay popup, setting the number of turns, alt tabbing to start Very Sleepy, returning to start AIAutoPlay and keeping an eye to stop Very Sleepy when AIAutoPlay ends. Needless to say, this method does not give enough precision to compare :p

To solve this I want to automate the process so it does not rely on me. I managed to start Civ with my testing savegame directly using /FXSLOAD. Now I need to hack AIAutoPlay so it starts automatically after loading a game for a given number of turns and that it closes the the game after that number of turns. That way, the time of the test would be automated and I could compare results more easily. Has anyone tried to do something like this before?
 
As accurate as possible :)

I need to be able to compare different results. Unless I'm reasonably sure that my profiling is accurate, I can't tell if a better result on time is caused by my improvements or by me noticing that it finished earlier than in the previous test. Besides that, if the start and stop can be fully automated, I can run a lot of tests in a batch script while I do something else.
 
Top Bottom