Opened 5 years ago
Closed 5 years ago
#18969 closed enhancement (fixed)
Improve performance of validator checks
Reported by: | GerdP | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | 20.03 |
Component: | Core validator | Version: | |
Keywords: | performance | Cc: |
Description (last modified by )
Some tests are executed for each element of the data set although they are only interested in tagged objects. Mosts tests which extend Test.TagTest should override method isPrimitiveUsable()
like this to check isTagged()
first:
@Override public boolean isPrimitiveUsable(OsmPrimitive p) { return p.isTagged() && super.isPrimitiveUsable(p); }
to improve performance.
Be careful, see r16154
Attachments (0)
Change History (7)
comment:1 by , 5 years ago
comment:3 by , 5 years ago
Keywords: | performance added |
---|---|
Milestone: | → 20.03 |
comment:4 by , 5 years ago
For most nodes p.isTagged() return false.
Without the change we calculate
p.isUsable() && (!(p instanceof Way) || (((Way) p).getNodesCount() > 1)); p.accept(this) -> visitor.visit(this) -> check(n)
In Lanes.check(n)
we do three times e.g. tr("Number of lane dependent values inconsistent") followed by a p.keySet().stream() which creates an empty collection for those untagged nodes.
The three tr() calls should probably not be done in check for each primitive?
comment:6 by , 5 years ago
Description: | modified (diff) |
---|
comment:7 by , 5 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Found no further simple changes which improve performance.
In 16198/josm: