Modify ↓
#16982 closed enhancement (fixed)
[Patch] small improvement for MapCSSTagChecker
Reported by: | GerdP | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | 18.11 |
Component: | Core validator | Version: | |
Keywords: | performance | Cc: |
Description (last modified by ) ¶
What steps will reproduce the problem? ¶
- Execute validator on a normal dataset
What is the expected result? ¶
What happens instead? ¶
Please provide any additional information below. Attach a screenshot if possible. ¶
I've noticed that this constructor is executed thousands of times:
public MapCSSTagChecker() { super(tr("Tag checker (MapCSS based)"), tr("This test checks for errors in tag keys and values.")); }
The reason is this code line:
final TestError error = check.getErrorForPrimitive(p, selector, env, new MapCSSTagCheckerAndRule(check.rule));
which is executed for many nodes because of rules like this
way[highway][area!=yes][!tunnel][!covered] > node { set node_in_highway; }
The attached mini patch avoids this by checking first if check.errors is empty.
Build-Date:2018-11-11 09:58:32 Revision:14419 Is-Local-Build:true Identification: JOSM/1.5 (14419 SVN en) Windows 10 64-Bit OS Build number: Windows 10 Home 1803 (17134) Memory Usage: 1550 MB / 3641 MB (416 MB allocated, but free) Java version: 1.8.0_191-b12, Oracle Corporation, Java HotSpot(TM) 64-Bit Server VM Screen: \Display0 1920x1080 Maximum Screen Size: 1920x1080 VM arguments: [-agentlib:jdwp=transport=dt_socket,suspend=y,address=localhost:57364, -ea, -Dfile.encoding=UTF-8] Plugins: + OpeningHoursEditor (34535) + apache-commons (34506) + buildings_tools (34572) + download_along (34503) + ejml (34389) + geotools (34513) + jaxb (34506) + jts (34524) + measurement (34529) + merge-overlap (34664) + o5m (34405) + opendata (34698) + pbf (34576) + poly (34546) + reverter (34552) + undelete (34568) + utilsplugin2 (34506) Map paint styles: - https://josm.openstreetmap.de/josmfile?page=Styles/PublicTransport&zip=1 Last errors/warnings: - W: Update plugins - org.openstreetmap.josm.plugins.PluginHandler$UpdatePluginsMessagePanel[,0,0,0x0,invalid,layout=java.awt.GridBagLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=9,maximumSize=,minimumSize=,preferredSize=] - W: No configuration settings found. Using hardcoded default values for all pools.
Change History (5)
by , 6 years ago
Attachment: | mini.patch added |
---|
comment:1 by , 6 years ago
Description: | modified (diff) |
---|
comment:2 by , 6 years ago
Milestone: | → 18.11 |
---|
Note:
See TracTickets
for help on using tickets.
looks fine