d.vect speed [was: Re: [GRASS-dev] wxpython gui: speed of display]

Moritz Lennert mlennert at club.worldonline.be
Thu Sep 14 18:05:39 EDT 2006


On Thu, August 17, 2006 03:45, Glynn Clements wrote:
> Beyond that, immediate rendering makes it feasible to profile d.vect
> to find out where the CPU cycles are being spent (this isn't practical
> when the rendering process is split between d.vect, the PNG driver,
> and the kernel).
>
> If you want to try that, you need to add -pg to CFLAGS and LDFLAGS,
> and use --disable shared (also, there are problems with lib/init; that
> needs to be compiled without -pg). Running any program will produce a
> file named gmon.out, which can be analysed using gprof.

I have finally gotten around to doing this.

Results are in d.vect.profile_ifloor.gz.

In there I noticed the very important position of ifloor which is defined
in lib/gis/plot.c. I tried to replace it (and iceil) with the floor and
ceil functions in math.h (see plot.c.diff) to see what happens. Profile
results of that are in d.vect.profile_floor.gz. Using time I timed a
'd.vect type=area fcol=none' command with the two different version of
plot.c:

with ifloor/iceil
real    0m2.279s
user    0m1.544s
sys     0m0.568s

with floor/ceil
real    0m3.820s
user    0m3.380s
sys     0m0.436s

so my change didn't help at all. It gets even worse when I try without
fcol=none:

with ifloor/iceil
real    0m2.477s
user    0m1.916s
sys     0m0.560s

with floor/ceil
real    0m4.931s
user    0m4.396s
sys     0m0.536s


Maybe I am not interpreting the profile info correctly...

Moritz
-------------- next part --------------
A non-text attachment was scrubbed...
Name: d.vect.profile_ifloor.gz
Type: application/gzip
Size: 21364 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/grass-dev/attachments/20060915/d48e6c5d/d.vect.profile_ifloor.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: plot.c.diff
Type: text/x-patch
Size: 4191 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/grass-dev/attachments/20060915/d48e6c5d/plot.c.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: d.vect.profile_floor.gz
Type: application/gzip
Size: 20719 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/grass-dev/attachments/20060915/d48e6c5d/d.vect.profile_floor.bin


More information about the grass-dev mailing list