Stupid optimization

I spent an hour today trying to “optimize” the performance of game within a game. It has to do with clearing out DirectX objects. Problem is, it’s only slow when I run in the debugger (which is most of the time). In release, it’s instant. So there was no point in optimizing it.

20,612 views 8 replies
Reply #1 Top

The nerd in me wishes I understood coding so that I too could understand your nerd-speak....

 

 

Reply #2 Top

Heh, yea, that tends to happen. I wrote a precaching system for my game to avoid what I thought was a long series of loops that works in a trial-and-error way, just to find when testing that all the loops took 0.1 seconds to complete!

Reply #3 Top

Premature optimization is the root of all evil... Or did you forget?

Reply #4 Top

Oh, I prefer

exception

when others

then null;

 

as the root of all evil. But meh, I code in PL/SQL.

Reply #5 Top

Good optimization is never lost when you have a moddable game.

Did you try to see the difference when you get a game within a game that is for 32 factions on a very very very very very very large map ? You advertized us for those kind of map when you were on WoM. I still hope our 64bit systems with 16 gig will be able to create games that last a year or more ;)

Reply #6 Top

I have had this issue before... but optimizing for debug mode is nice if it means the game is playable in debug mode (great for tracking down reproducible crashes). 

Reply #7 Top


I spent an hour today trying to “optimize” the performance of game within a game. It has to do with clearing out DirectX objects. Problem is, it’s only slow when I run in the debugger (which is most of the time). In release, it’s instant. So there was no point in optimizing it.

Time spend making or improving development tools is never lost if it saves you time in the long run. Never tell your self that. The engineer in you know it is the right thing to do.

Reply #8 Top

It would still be interesting to know the root cause of why the optimized code was so many orders of magnitude faster than debug.  Especially if it has to do with DirectX, since I plan on diving into CUDA before too long.  Knowing that bottleneck might give clues to other performance problems, particularly if it involves some sort of unnecessary and complex handshake between the CPU and GPU.