[Patch] improve performance in Renderer
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
(7)
Description: |
modified (diff)
|
Cc: |
bastiK simon04 added
|
Component: |
Core → Core mappaint
|
Keywords: |
performance added
|
Milestone: |
→ 16.08
|
Resolution: |
→ fixed
|
Status: |
new → closed
|
Sorry, one relation rule needs it:
So the search is needed in rare cases, but executed quite often, e.g. for this rule.
The index is not needed, we just want to know if the node is member of a way.