Rework OSM tag key handling

Authored by vkrause on May 26 2020, 4:28 PM.

Description

Rework OSM tag key handling

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.

Details

Committed
vkrauseMay 26 2020, 4:28 PM
Parents
R1032:3bb6a23f5d5c: Fix name-based location lookup on the German OTP backends
Branches
Unknown
Tags
Unknown