Skip to content
  • Volker Krause's avatar
    Rework OSM tag key handling · 85fa9ca5
    Volker Krause authored
    This now uses opaque keys that only cost a single pointer comparison,
    rather than a QString. This saves memory in loading, but more importantly
    it significantly speeds up MapCSS rule evaluation, especially as the
    complexity of the styles keeps growing.
    
    This however requires some extra work to translate key names to the new
    keys, requiring a preparation step on the CSS rules that ties them to a
    specific data set.
    
    String-based lookup still exists for compatibility (e.g. for the generator
    code that isn't performance-sensitive), but that's now O(N) rather than
    O(logN). The impact of that is surprisingly small even, given we usually
    only have a small amount of tags per element.
    
    Overall this brings a 20-40% speed-up on scene updates, due to the faster
    CSS evaluation. That's still the number one cost still, but all the string
    comparison cost there is gone.
    85fa9ca5