[geos-devel] Coordinate & Coordinate list

Norman Vine nhv at cape.com
Thu Nov 14 19:00:30 EST 2002


David Blasby writes:


> Martin Davis wrote:
>
> > Not sure about the reason for the large number of Coordinate allocations.  I think we should make the obvious changes to the
CoordinateList interface and then rerun the metrics, since things may change quite a bit.
>
> I thought it was actually calling the "new Coordinate(...)" constructor.  Now I'm thinking its actually calling a auto-generated
"copy" constructor.
>
> If you look at the CoordinateList class, the
>
> get(int) method calls the get() method.  The get() method copy-creates a Coordinate, which might be  copy-created (again) in the
get(int) method, and again copy-created in the caller's "=" assignment.


Yes I believe this is exactly what is going on
FWI - I dumped the assembly for the Coordinate functions
and this is what led me to say

"there seems to be a LOT  of information being passed on the stack in
GEOS which doesn't necessarily need to be."   in an earlier message


> Norman, how (exactly) did you get gprof to profile the library calls to get your profile results.

you add the profiling statistics gathering flag to the compiler options

-pg

do
% make clean && make

Run the program as usual

then run gprof on the resulting 'profiler statistics' file

on my system this is

% gprof executable_file gmon.out > humman_readable_file

% info gprof   should give you all you need to know

Norman






More information about the geos-devel mailing list