Modify

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#13396 closed enhancement (fixed)

[Patch] improve performance in Renderer

Reported by: GerdP Owned by: team
Priority: normal Milestone: 16.08
Component: Core mappaint Version:
Keywords: performance Cc: bastiK, simon04

Description (last modified by Don-vip)

I've noticed that MatchingReferrerFinder.visit(Way w) is using a sequential search through all way nodes to find the index of the node. This index is only used when the corresponding style rule uses it, in the default file elemstyles.mapcss no rule uses it. The same seq. search is done for members of relations, and again, no default rule uses this. I've created a quick hack which avoids the search when the only information that is needed is whether the parent way (relation) matches.

I guess a cleaner solution would be to add a boolean field indexNeeded in the selector which would be set when the rule contains the index clause (or the role clause).
I leave that to the experts.

Attachments (1)

fasterSelector.patch (1.3 KB) - added by GerdP 3 years ago.

Download all attachments as: .zip

Change History (7)

Changed 3 years ago by GerdP

Attachment: fasterSelector.patch added

comment:1 Changed 3 years ago by GerdP

Sorry, one relation rule needs it:

relation[type=enforcement] >[role="device"] node {
    icon-image: "presets/vehicle/restriction/speed_camera.svg";
    set icon_z17;
}

So the search is needed in rare cases, but executed quite often, e.g. for this rule.

way > node[!setting("shrink_nodes")]            { symbol-size: 4; }

The index is not needed, we just want to know if the node is member of a way.

Last edited 3 years ago by Don-vip (previous) (diff)

comment:2 Changed 3 years ago by Don-vip

Description: modified (diff)

comment:3 Changed 3 years ago by Don-vip

Cc: bastiK simon04 added
Component: CoreCore mappaint

comment:4 Changed 3 years ago by Don-vip

Keywords: performance added
Milestone: 16.08

comment:5 Changed 3 years ago by Don-vip

Resolution: fixed
Status: newclosed

In 10882/josm:

fix #13396 - improve performance in Renderer (patch by Gerd Petermann, modified to remove code duplication, using Java 8 int functions)

comment:6 Changed 3 years ago by GerdP

BTW: This also improves performance of the Validator (Tag Checker) a bit.

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.