[MUD-Dev] Text Parsing
J C Lawrence
claw at varesearch.com
Thu Jun 10 19:34:55 CEST 1999
On Wed, 9 Jun 1999 20:13:58 -0700 (PDT)
Matthew Mihaly <diablo at best.com> wrote:
> On Wed, 9 Jun 1999, Chris Gray wrote:
>> [Matthew Mihaly:]
>> The main advice that has been given here in the past is to
>> profile your code. If it's C or C++ code, compile it with -p or
>> -pg flags, and run it for a while. Collect the results and see
>> where all of your time is going. Let us know the results, and
>> I'm sure lots of further advice will follow from there.
> Yeah, I profiled it all. Mob ai is taking up about 20% of
> processor time, and player movement is quite slow, taking up to
> .07 seconds when malloc is low (our server has an irritating
> little memory leak, which we're working to fix).
In which case I would suspect architectural weaknesses, such as the
code repatedly checking or doing work which is not strictly
necessary to do. Some standard and commong examples of such
enclude:
Polling loops.
Linear data set traversals (versus indexes, hashes or other lookup
mechanisms)
Balanced data structures used for rapidly changing data sets
Repeated avoidable large working set changes
Spinlock abusive IO techniques
> So really, at most, that accounts for, on the high end, say, 35%
> of processor time. The other 65% seems to be reasonably
> well-distributed among everything else.
Which is the point. That's a heck of a lot of CPU to burn not doing
much. The task is to find out what you are doing that you don't
need to be doing.
--
J C Lawrence Home: claw at kanga.nu
---------(*) Linux/IA64 - Work: claw at varesearch.com
... Beware of cromagnons wearing chewing gum and palm pilots ...
_______________________________________________
MUD-Dev maillist - MUD-Dev at kanga.nu
http://www.kanga.nu/lists/listinfo/mud-dev
More information about the mud-dev-archive
mailing list