[geos-devel] RE: LineSegment copy removal, ABI protection 2
Martin Davis
mbdavis at VividSolutions.com
Mon Jun 27 15:58:21 EDT 2005
> Martin, should LineSegment store REAL coordinates or can it
> safely store references to them ?
References should be safe - LineSegment never changes its coordinates.
It may reorder them, however (but this should work with references,
right)?
I didn't get the attachment - is this a fix that might be good for JTS
too?
Martin Davis, Senior Technical Architect
Vivid Solutions Inc. www.vividsolutions.com
Suite #1A-2328 Government Street Victoria, B.C. V8T 5G5
Phone: (250) 385 6040 - Local 308 Fax: (250) 385 6046
> -----Original Message-----
> From: strk at refractions.net [mailto:strk at refractions.net]
> Sent: June 27, 2005 11:41 AM
> To: geos-devel at geos.refractions.net; Martin Davis
> Subject: LineSegment copy removal, ABI protection 2
>
>
> I've found that many of the Coordinate copies are
> done within LineSegment. LineSegment contains two
> points and ops on them.
>
> Fiddling with SubgraphDepthLocater I've handled
> to reduce run time of the attached test from
> 279.71 to 17.17 seconds !
>
> I obtained this avoiding to construct a LineSegment
> until really needed.
>
> % cumulative self self total
> time seconds seconds calls s/call
> s/call name 84.82 237.26 237.26
> 7645820 0.00 0.00 geos::LineSegment::reverse()
>
> Martin, should LineSegment store REAL coordinates or can it
> safely store references to them ?
>
> ... this change would break both ABI and API, probably unused
> parts but still ... maybe we should add a new class like
> LightLineSegment to avoid it in this case.
>
> --strk;
>
More information about the geos-devel
mailing list