How to use MOZILLA_GPROF
(Courtesy djw@avantgo.com)This is currently almost-compiling on Solaris 2.5.1
as of Wed Oct 7 02:18:03 PDT 1998 -mcafee
So you want to know why something is slow? Want to know what the !!!!! the thing is doing? Read on... I've just checked in a relatively easy to use gmon/gprof based profiler into the tree. You can start the profiler, stop the profiler, reset the profiler, etc... right from your very own browser, or editor, or mail/news,...... (there is a menu based interface to the profiler under the Help menu). The best part is you can get a HTML profile report printed into your browser! I've attached a sample. It's the top 100 functions that are exercised during startup. The report shows the time spent in each function, sorted from highest to lowest. It also shows the executation "arcs" - foo called bar called zoo, and we did this 30% of the time. I'll be writing up more detailed info, but for now, if you want to try it: 1) get you to a Sun box (sorry, this stuff is extremely platform specific, SGI coming). 2) pull a tree, or update, whatever (my changes are in cmd/xfe and cmd/xfe/src). 3) set MOZILLA_GPROF in your environment or myconfig.mk 4) rebuild everything (MOZILLA_GPROF sets a special compile option) 5) preferably build netscape-export 6) run and enjoy (hint: look under the Help menu). 7) check out the (somewhat dry) man page for gprof(1), it'll help interpret the report. With the profiler running there is slight performance slowdown (maybe 5-10%). By default, the profiler is running at startup. You can set the initial state to off using: setenv MOZILLA_GPROF "running=false" An optimized build (with DEBUG not set) will give you the most accurate data, but you can build MOZILLA_GPROF and -g just fine. It'll run just a little slower.mcafee@netscape.com