Modify

Opened 8 years ago

Closed 8 years ago

Last modified 8 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 8 years ago.

Download all attachments as: .zip

Change History (7)

by GerdP, 8 years ago

Attachment: fasterSelector.patch added

comment:1 by GerdP, 8 years ago

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 8 years ago by Don-vip (previous) (diff)

comment:2 by Don-vip, 8 years ago

Description: modified (diff)

comment:3 by Don-vip, 8 years ago

Cc: bastiK simon04 added
Component: CoreCore mappaint

comment:4 by Don-vip, 8 years ago

Keywords: performance added
Milestone: 16.08

comment:5 by Don-vip, 8 years ago

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

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