February 1999
- client images Chris Gray
- Question on c++ switch optimization, and parsers in general. Ben Greear
- Question on c++ switch optimization, and parsers in general. Adam Wiggins
- Question on c++ switch optimization, and parsers in general. Ola Fosheim Grøstad
- Question on c++ switch optimization, and parsers in general. Chris Gray
- Question on c++ switch optimization, and parsers in general. Chris Gray
- Question on c++ switch optimization, and parsers in general. T. Alexander Popiel
- Question on c++ switch optimization, and parsers in general. Ola Fosheim Grøstad
- Question on c++ switch optimization, and parsers in general. Richard Woolcock
- Question on c++ switch optimization, and parsers in general. Marc Hernandez
- Question on c++ switch optimization, and parsers i Chris Gray
- Question on c++ switch optimization, and parsers i Jon A. Lambert
- Question on c++ switch optimization, and parsers i Chris Gray
- optimizing code diablo@best.com
- optimizing code Hans-Henrik Staerfeldt
- optimizing code Chris Gray
- code profiling Chris Gray
Since there has been recent discussion here of finding performance
problems and code profiling, I thought I'd briefly relate my experience
with this from the last half hour.
When I left my server over the weekend, I had been messing around with
some changes to my database. As part of that I had implemented some
data structure consistency checking, which I had forgotten I'd left
enabled. Well, of course the performance was quite poor. So, in testing
the performance effects of some changes, I was quite disappointed in
the result. Tonight I turned those changes off, and performance was still
terrible - much moreso that what I remembered. What was wrong? Profiling
to the rescue. I deleted my object files and re-compiled (using gcc)
with '-pg' enabled. Run my server for a couple of seconds, then shut it
down (there are 150 or so "machines" in my testbed database right now).
Run "gprof MUDServ | more", and the culprit (the consistency checker
routine" was blindingly obvious - it was using 95% of the time. So,
turn it off. Try again - much better! The top few lines now are:
% cumulative self self total
time seconds seconds calls ms/call ms/call name
26.75 0.65 0.65 736529 0.00 0.00 ioRead
22.63 1.20 0.55 636842 0.00 0.00 runExec
7.41 1.38 0.18 8890 0.02 0.02 ioCacheFree
4.94 1.50 0.12 11579 0.01 0.01 sendToMachines
4.94 1.62 0.12 10029 0.01 0.01 ForEachAgent
2.88 1.69 0.07 3498226 0.00 0.00 trace
....
'ioRead' fetches things from the database. Unexpectedly high - I'll
have to have a good look at it. 'runExec' is the main body of my
MUD-language interpreter; I expect that to be quite high. 'ioCacheFree'
is also in the DB cache - when a block is freed, that routine trys to
merge it with other free ones - could be expensive when I'm pounding
on the DB (3/4 million reads in 2.5 seconds). 'sendToMachines' and
'ForEachAgent' are used to tell characters (PC and NPC) about things
happening in the same location as them. Not unexpected when 150 NPC's
are moving at about 2-second intervals. I need better searching.
So, as you can see, a simple run using compiler profiling can tell
you an awful lot about where to look for performance improvements. The
amount of work is minimal. Fixing the problems is a lot harder!
--
Don't design inefficiency in - it'll happen in the implementation. - me
Chris Gray cg@ami-cg.GraySage.Edmonton.AB.CA
http://www.GraySage.Edmonton.AB.CA/cg/ - World-file parsing and RTTI? The Arrow
- World-file parsing and RTTI? Mark Gritter
- pet peeves diablo@best.com
- pet peeves diablo@best.com
- pet peeves Caliban Tiresias Darklock
- pet peeves Marc Bowden
- pet peeves Richard Woolcock
- pet peeves Koster, Raph
- pet peeves diablo@best.com
- pet peeves Caliban Tiresias Darklock
- pet peeves Kristen Koster
- pet peeves Caliban Tiresias Darklock
- pet peeves Adam Wiggins
- pet peeves Wes Connell
- pet peeves J C Lawrence
- pet peeves Matthew Mihaly
- pet peeves Ling
- pet peeves Ola Fosheim Grøstad
- pet peeves Matthew Mihaly
- pet peeves Ola Fosheim Grøstad
- pet peeves Matthew Mihaly
- pet peeves David Bennett
- pet peeves Robert Woods
- pet peeves Wes Connell
- pet peeves Travis S. Casey
- pet peeves Matthew Mihaly
- pet peeves Neerenberg, AaronX
- pet peeves greg
- pet peeves Richard Woolcock
- pet peeves J C Lawrence
- pet peeves Martin Keegan
- pet peeves Ola Fosheim Grøstad
- pet peeves J C Lawrence
- pet peeves diablo@best.com
- pet peeves Brandon A Downey
- pet peeves diablo@best.com
- pet peeves Darren Henderson
- pet peeves diablo@best.com
- pet peeves Darren Henderson
- pet peeves Steve Houchard
- pet peeves diablo@best.com
- pet peeves Darren Henderson
- pet peeves diablo@best.com
- pet peeves Steve Houchard
- pet peeves diablo@best.com
- pet peeves Richard Woolcock
- pet peeves diablo@best.com
- pet peeves Richard Woolcock
- pet peeves Apocalypse
- pet peeves Caliban Tiresias Darklock
- pet peeves diablo@best.com
- pet peeves Adam Wiggins
- pet peeves diablo@best.com
- pet peeves Adam Wiggins
- pet peeves diablo@best.com
- pet peeves Mik Clarke
- pet peeves Caliban Tiresias Darklock
- pet peeves Travis S. Casey
- pet peeves Caliban Tiresias Darklock
- pet peeves Benjamin D. Wiechel
- pet peeves Marc Bowden
- pet peeves Matthew Mihaly
- pet peeves Mik Clarke
- pet peeves Benjamin D. Wiechel
- pet peeves Matthew Mihaly
- pet peeves Caliban Tiresias Darklock
- pet peeves Marc Bowden
- pet peeves Matthew Mihaly
- pet peeves David Bennett
- pet peeves David Bennett
- pet peeves Petri Virkkula
- pet peeves J C Lawrence
- Horror Themed Muds [was CthulhuMud Driver 6] Christopher Allen
- Horror Themed Muds [was CthulhuMud Driver 6] Caliban Tiresias Darklock
- Horror Themed Muds [was CthulhuMud Driver 6] Mik Clarke
- CthulhuMud Driver 6 Mik Clarke
- CthulhuMud Driver 6 J C Lawrence
- Mathengine Ling
- Mathengine Apocalypse
- Website update Koster, Raph
- Influential muds Koster, Raph
- Influential muds Dan Shiovitz
- Influential muds Adam Wiggins
- Influential muds Sunny Gulati
- Influential muds diablo@best.com
- Influential muds Juha Lindfors
- Influential muds Brandon J. Rickman
- Influential muds Caliban Tiresias Darklock
- Influential muds Andy Cink
- Influential muds J C Lawrence
- Influential muds Dr. Cat
- Influential muds Jay Carlson
- Influential muds Mik Clarke
- Influential muds Richard Woolcock
- Influential muds Koster, Raph
- Influential muds Mik Clarke
- Influential muds Ola Fosheim Grøstad
- Influential muds Dan Root
- Influential muds Benjamin D. Wiechel
- State of the art? Andy Cink
- State of the art? diablo@best.com
- State of the art? Caliban Tiresias Darklock
- State of the art? ##Make Nylander
- State of the art? diablo@best.com
- State of the art? Martin Keegan
- State of the art? David Bennett
- State of the art? Martin Keegan
- State of the art? Andy Cink
- State of the art? J C Lawrence
- State of the art? David Bennett
- State of the art? Matthew Mihaly
- State of the art? Caliban Tiresias Darklock
- State of the art? Matthew Mihaly
- State of the art? Ola Fosheim Grøstad
- State of the art? Ola Fosheim Grøstad
- State of the art? J C Lawrence
- State of the art? Matthew Mihaly
- State of the art? Mik Clarke
- State of the art? J C Lawrence
- The Terrorist Class Ola Fosheim Grøstad
- The Terrorist Class Mik Clarke
- Welcome To "MUD-Dev"! mud-dev-admin@kanga.nu
- IMPORTANT ADMIN: New list setup requires your attention J C Lawrence
- ADMIN: URL change J C Lawrence
- PermaDeath (was pet peeves) Marc Hernandez
- ScryMUD 1.8.7 released. Ben Greear
- PermaDeath Sayeed
- PermaDeath Ola Fosheim Grøstad
- PermaDeath Sayeed
- roleplaying and immersion (was: PermaDeath) Ola Fosheim Grøstad
- Roleplaying and Immersion (was: PermaDeath) Sayeed
- Roleplaying and Immersion (was: PermaDeath) Adam Wiggins
- Roleplaying and Immersion (was: PermaDeath) J C Lawrence
- Roleplaying and Immersion (was: PermaDeath) Ola Fosheim Grøstad
- WEB: VR-stuff Ola Fosheim Grøstad
- WEB: VR-stuff J C Lawrence
- WEB: VR-stuff Mik Clarke
- WEB: VR-stuff Marian Griffith
- WEB: VR-stuff J C Lawrence
- ADMIN: The list archives are now online and fully searchable J C Lawrence
- Theories was pet peeves Wes Connell