Modify

Opened 5 months ago

Closed 5 months ago

Last modified 5 months ago

#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 Don-vip)

What steps will reproduce the problem?

  1. 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.

Attachments (1)

mini.patch (873 bytes) - added by GerdP 5 months ago.

Download all attachments as: .zip

Change History (5)

Changed 5 months ago by GerdP

Attachment: mini.patch added

comment:1 Changed 5 months ago by Don-vip

Description: modified (diff)

comment:2 Changed 5 months ago by Don-vip

Milestone: 18.11

looks fine

comment:3 Changed 5 months ago by GerdP

Resolution: fixed
Status: newclosed

In 14420/josm:

fix #16982

comment:4 Changed 5 months ago by GerdP

In 14421/josm:

fix fix #16982, now really

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.