Opened 7 years ago
Closed 4 years ago
#15170 closed enhancement (wontfix)
[Patch] SimplifyWayAction optimizations.
Reported by: | shinigami | Owned by: | shinigami |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | Core | Version: | |
Keywords: | performance | Cc: |
Description (last modified by )
I suppose it is not problem in common use case, but this action is used by OpenData plugin, where it is called for every loaded (sometimes very long) way.
It seems that delNodes and newNodes (in simplifyWay) often contains same data. Problem is that in such case AbstractSet.removeAll is processed as repetitive scanning of given collection and it leads to o(n2) complexity.
Another big slowdown is counting of node frequency in method isRequiredNode, it iterates all way for every node. Simple precounted histogram of nodes makes it much faster.
Attachments (3)
Change History (9)
by , 7 years ago
Attachment: | simplifyway.patch added |
---|
comment:1 by , 7 years ago
Description: | modified (diff) |
---|
by , 7 years ago
Attachment: | simplifyway2.patch added |
---|
comment:2 by , 7 years ago
Keywords: | performance added |
---|---|
Summary: | SimplifyWayAction optimizations. → [Patch] SimplifyWayAction optimizations. |
comment:3 by , 7 years ago
One of sets is http://efele.net/maps/tz/world/tz_world.zip - borders of all timezones.
I measured time of OsmImporter.createLayer, it id ~4x faster now.
Other data I used to test are borders of countries extracted from OSM, one multipolygon for one country.
OsmImporter.createLayer takes about 16s now, did not measure it before, but it was enough to have
a lunch:).
Both were measured with latest jdk8.
by , 7 years ago
Attachment: | course.patch added |
---|
comment:4 by , 7 years ago
One little update yet - two invocations of cos(lat2) extracted to variable.
comment:5 by , 5 years ago
Owner: | changed from | to
---|---|
Status: | new → needinfo |
comment:6 by , 4 years ago
Resolution: | → wontfix |
---|---|
Status: | needinfo → closed |
Thanks, some questions: