Opened 4 years ago
Last modified 4 years ago
#22115 closed defect
[PATCH][RFC] Extract methods from LatLon into ILatLon where they are generally applicable — at Version 1
| Reported by: | taylor.smock | Owned by: | team |
|---|---|---|---|
| Priority: | normal | Milestone: | 22.06 |
| Component: | Core | Version: | |
| Keywords: | performance | Cc: |
Description (last modified by )
The attached patch does the following:
- Moves
greatCircleDistanceandbearingintoILatLonfromLatLon - 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#getCoorand then directly passes the result into something that acceptsILatLon, theNodeis 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).
Note: I'm not sold on the @deprecation annotations. I'd like to be able to remove the methods from LatLon someday, but those methods are used a lot, so there will be a lot of breakage when we do remove them.
Change History (2)
by , 4 years ago
| Attachment: | 22115.patch added |
|---|
comment:1 by , 4 years ago
| Description: | modified (diff) |
|---|---|
| Milestone: | → 22.06 |
| Summary: | [PATCH] Extract methods from LatLon into ILatLon where they are generally applicable → [PATCH][RFC] Extract methods from LatLon into ILatLon where they are generally applicable |


