On Sat, 30 Oct 2004, Michael Wheeler wrote:
Thanks for the directions. I think I could handle this under Linux, but it may be over my head with Win32. However, it seems to me that the slow rendering problems are occurring on all platforms (or is it just that my Linux box is slow?) so maybe it would still be worth it for me to give this a shot under Linux?
Yeah, couldn't hurt to do it under Linux. Once you get comfortable with it there, maybe it'd not be too hard to try it under Win32.
Also, should these directions be added to the wiki?
Yes, it'd be great if you could add them. Potentially there could be a lot of profiling/optimization work to do, and a place to capture howtos and best practices would be quite valuable.
Thanks, Bryce
Bryce Harrington wrote:
Here is how I've done profiling for Inkscape in the past. I have no idea if this will work on Win32 though since profiling requires kernel calls, so you may have to do some adapting.
There are essentially three major steps:
A) Compile the application with profiling support
B) Run the application in a "certain way"
C) Run gprof to generate analysis reports
For Step A what you need to do is add the -pg option to the compiler. You can do this via the CFLAGS variable at configure time. For example in Bash:
$ CFLAGS='-pg' ./configure $ make
Step B is where some creativity is needed. You'll probably want to do several profiling runs to get the hang of it. Essentially, you want to exercise the part of the program you're most interested in measuring. For instance, if you're measuring the speed of rendering stars, you may want to create a document full of zillions of stars, and start Inkscape with that file, then immediately close when it finishes rendering.
As part of Step B, a special output file is generated (called a.out by default I think). In Step C, you run gprof on this file to generate different sorts of reports, such as the flat profile and call graph. So for example:
$ gprof --exec-counts a.out $ gprof --graph a.out
See the gprof manpage for all the analysis report options.
Bryce