Opened 9 years ago

Last modified 9 years ago

#13396 closed enhancement

[Patch] improve performance in Renderer — at Version 2

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.

Change History (3)

by GerdP, 9 years ago

Attachment: fasterSelector.patch added

comment:1 by GerdP, 9 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 9 years ago by Don-vip (previous) (diff)

comment:2 by Don-vip, 9 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.