[geos-devel] Coordinate & Coordinate list

Martin Davis mbdavis at VividSolutions.com
Thu Nov 14 18:30:39 EST 2002


Good point about returning a pointer instead of a value.  Or even better I think (certainly a more precise reflection of the usage), return a reference.

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.

Martin Davis, Senior Technical Specialist
Vivid Solutions Inc.
Suite #1A-2328 Government Street   Victoria, B.C.   V8T 5G5
Phone: (250) 385 6040    Fax: (250) 385 6046
EMail: mbdavis at vividsolutions.com  Web: www.vividsolutions.com


> -----Original Message-----
> From: David Blasby [mailto:dblasby at refractions.net]
> Sent: Thursday, November 14, 2002 3:10 PM
> To: geos-devel at geos.refractions.net
> Subject: Re: [geos-devel] Coordinate & Coordinate list
> 
> 
> Good points, Martin.
> 
> The profing of GEOS seemed to indicate that most of the time 
> was spent constructing and get()ing coordinates.  I think the 
> get() function should be returning pointers to coordinates 
> instead of actual coordinates (which require quite a bit of 
> memory moving and allocation).
> 
> The important thing is to *not* return a Coordinate, but a 
> pointer-to-coordinate.
> 
> Any word on why there were 250 million Coordinate constructions?
> 
> dave
> ps. I checked  and Coordinate is only 24 bytes long (I 
> thought there would be a bunch of other information in it for 
> the class and class methods).
> 
> pps. you're right about array-of-pointers being less 
> efficient.  I thought they would be more efficient because 
> your memory space wouldnt be chopped-up so much, but after 
> thinking about it, the malloc() free table should be pretty empty.
> 
> 
> 
> _______________________________________________
> geos-devel mailing list
> geos-devel at geos.refractions.net
> http://geos.refractions.net/mailman/listinfo/geos-devel
> 




More information about the geos-devel mailing list