Opened 4 years ago

Last modified 4 years ago

#22115 closed defect

[PATCH] Extract methods from LatLon into ILatLon where they are generally applicable — at Initial Version

Reported by: taylor.smock Owned by: team
Priority: normal Milestone: 22.06
Component: Core Version:
Keywords: performance Cc:

Description

The attached patch does the following:

  • Moves greatCircleDistance and bearing into ILatLon from LatLon
  • Where possible, remove getCoor() calls and instead call the appropriate method directly
  • Deprecates the original methods (rather unfortunately, this does mean we will have deprecation warnings when compiling for a bit, as most of the remaining calls deal with EastNorth conversions)
  • Where possible (when noticed), if something calls Node#getCoor and then directly passes the result into something that accepts ILatLon, the Node is now passed instead.

This does not move interpolate and getCenter, as both return a LatLon.

For those reading the code, Node extends INode which extends ILatLon.

This should decrease overall memory allocations significantly. One major win is in SearchCompiler#match, where a Bounds#contains(LatLon) is replaced by Bounds#contains(ILatLon), where the ILatLon is the Node (in a validation test of Mesa County, Colorado, the getCoor call accounted for 284 MiB of 740 MiB memory allocations for SearchCompiler#Match).

Change History (1)

by taylor.smock, 4 years ago

Attachment: 22115.patch added
Note: See TracTickets for help on using tickets.