On Thu, 28 Oct 2004, Michael Wheeler wrote:
bulia byak wrote:
I'll see what I can do. Do you have any suggestions? Is there any way I should be measuring this, other than with a stopwatch?
If you know how to profile, it would be nice if you could create a node-editing-specific profile (e.g. start the program with a file with a complex path, then do dragging nodes for a pretty long time so that it makes the program loading time small by comparison, and then examine the profile to see what functions take the longest time). If you don't know how to profile, ask here, it's simple (though I don't remember all details :)
I don't know how to profile, but I'd be willing to give it a shot if someone wouldn't mind explaining it to me (and assuming it isn't over my head). I'm on Win2k.
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