Modify

Opened 4 years ago

Closed 4 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 GerdP)

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 GerdP, 4 years ago

In 16198/josm:

see #18969: Improve performance of validator checks

comment:2 by Don-vip, 4 years ago

Does it really improve performance? If yes, I don't understand how.

comment:3 by Don-vip, 4 years ago

Keywords: performance added
Milestone: 20.03

comment:4 by GerdP, 4 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:5 by Don-vip, 4 years ago

ok thanks :)

comment:6 by GerdP, 4 years ago

Description: modified (diff)

comment:7 by GerdP, 4 years ago

Resolution: fixed
Status: newclosed

Found no further simple changes which improve performance.

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. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.