View Single Post
  #3  
Old 08-17-2010, 07:32 AM
Sakkath
Fire Beetle
 
Join Date: May 2009
Location: UK
Posts: 1
Default

Hey blmille2,
I know you've discounted the idea because the functionality is different, but here's my 2cents:
The general rule is that 80% of the processing time is spent in 20% of the code - depending on the application it might be even more concentrated. When optimising, it's best to focus on the bottlenecks that will yield the best result.
Sometimes you can make code faster by using more efficient instructions, although the biggest optimisations generally come from changing the program flow - for example caching values, reducing IO, breaking out of loops early etc.

Had your solution been correct, it would probably only have a very minimal impact, and on the downside it makes the code less readable as it's not as obvious what is being done.
I don't mean to discourage you at all - there is certainly a lot that can be optimise that would make the servers perform much better.
For instance, the Process_AI() loops are HUGE functions where the code checks over and over which class it's processing. They'd be much more efficient if they used a series of derived classes, i.e. Necro::Process_AI, Wizard::Process_AI etc.
Reply With Quote