I borrowed an older box with VC6 on it, finally got everything setup and got the project built. Now comes time to do the profiling. We didn't need anything clever, just some basic call counts and very rough percentage timings, so I just stuck some static counters in and a very rough profiler using c time functions and writing output to a file. Which led to the following conversation*:
Me : What file output and timing functions do we have in this code base?I hate VC6! (*conversation may not be word-for-word accurate)
I was going to use fstream and ctime, but I'm getting compile errors in xlocale.
Co-worker: Just use a FILE pointer.
Me : I'm getting errors about clock too.
Co-worker: Really? What sort of errors?
Me : It says clock is not a member of std
Me : Wait a minute. This is VC6. It's probably not a member of std.
Having finally got everything working the results were certainly interesting. It just goes to prove that even experts are pretty bad at guessing bottlenecks. Everyone expected the function I was profiling to be called a lot and to be taking up a large proportion of the execution time. The profiling results showed it was being called relatively infrequently and taking up a relatively small proportion of the total execution time. This is why you should always profile before spending time optimising.
Actually that's not the entire story. I was coming down with a mild flu-like bug whilst doing all this and so wasn't at my sharpest. After thinking about it over the weekend I suspect there might be another related function that also needs to be profiled. I'll probably have a look at that tomorrow.
I also got my first batch of free games this week. One of the advantages of working for a company that's owned by Sega is that I get a free copy of every game Sega publish! The initial batch wasn't overwhelming, Rome: Total War - Alexander (PC), Virtual Pro Football (PS2) and Let's Make a Soccer Team (PS2), but there are more interesting titles coming up.
I think that's all the news this week. I didn't manage to get much done on the mod front due to aforementioned flu-like bug. Hopefully one day in the not-to-distant-future I'll be able to post some screenshots of the mod stuff I'm working on since I'm sure you're all bored to death of reading my inane ramblings.