Skip to content

Rework parameterized header handling

Volker Krause requested to merge work/vkrause/qba-parameter-keys into master
  • Use std::map instead of QMap, we don't need the additional indirection for implicit sharing here.
  • Make use of the heterogeneous lookup support by std::map, which allows us to use views for lookups. That way we avoid allocations even without needing Qt's special literal types.
  • Use QByteArray for parameter keys. Those are ASCII-only anyway, so we avoid a bunch of conversion and only need half the memory for storing those.

Overall this removes 30% of the allocations needed for Content-Type header parsing in messageparserbenchmark.

This also adds a bunch of temporary deprecated inline helpers for source compatibility which we can remove again once all consumers are adjusted.

Needs !88 (merged) to build.

Merge request reports

Loading