#22104 closed defect (fixed)
[PATCH] Significantly reduce allocations in DataSetMerger when merging nodes
Reported by: | taylor.smock | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | 22.06 |
Component: | Core | Version: | |
Keywords: | performance | Cc: |
Description
When I was profiling the MapWithAI plugin, I noticed that DataSetMerger#merge
used ~400 MiB worth of allocations. With the attached patch, it uses ~19 MiB worth of allocations.
Steps to reproduce:
osm-download.bounds=39.0635486;-108.5716152;39.0708789;-108.5593414
- Enable
City of Grand Junction, CO
,Esri Community Trees
,Esri Roads Sample (Preview)
,MapWithAI
,Statewide Aggregate Addresses in Colorado 2019 (Public)
, andUnited States Addresses
. - Start profiling and download data + mapwithai data.
Attachments (1)
Change History (12)
by , 2 years ago
Attachment: | 22104.patch added |
---|
comment:1 by , 2 years ago
Keywords: | performance added |
---|
comment:2 by , 2 years ago
follow-up: 7 comment:5 by , 2 years ago
Replying to Don-vip:
In 18489/josm:
Fair enough. I hadn't done that since it would have automatically been fixed when/if we dropped the code in LatLon. I suppose I also could have cast the variables to ILatLon
as well.
follow-up: 8 comment:7 by , 2 years ago
Replying to taylor.smock:
Fair enough. I hadn't done that since it would have automatically been fixed when/if we dropped the code in LatLon. I suppose I also could have cast the variables to
ILatLon
as well.
I hesitated as well to remove the method immediately. But the code being there for a long time, it's safer to keep it deprecated for plugins we don't control.
comment:8 by , 2 years ago
Replying to Don-vip:
I hesitated as well to remove the method immediately. But the code being there for a long time, it's safer to keep it deprecated for plugins we don't control.
That is one of the reasons why I marked it as deprecated, instead of removing it. The hard part is that it shadows/overrides the ILatLon method without casting the second argument to an ILatLon (I don't believe the Java compiler is smart enough to understand LatLon#equalsEpsilon
is deprecated, so it should use ILatLon#equalsEpsilon
instead). So at some point, when we do decide to remove the method, we're going to have breakage.
With that being said, I do have a GitLab CI job I can use to find plugins where it will cause breakage.
comment:9 by , 2 years ago
Replying to Don-vip:
In 35975/osm:
Sorry, I missed this.
I was going to update the plugins after the next tested release. Mostly because I was going to try and do the changes for #22115 at the same time.
Anyway, I'll go ahead and do the changes that I intended to do for this ticket now, so I don't miss them (specifically, Node#getCoor#equalsEpsilon
-> Node#equalsEpsilon
).
Related ticket: #7159