Details
-
Task
-
Resolution: Fixed
-
P2: Important
-
None
-
None
-
-
8
-
Team B Foundation Sprint 60
Description
The propertyOrdering static data member injected by Q_PROTOBUF_OBJECT is currently a std::unordered_map. However, it is neither dynamically-sized nor does do we expect many entries.
A hash-map which allocates each of its elements in a separate memory allocation is therefore overkill. If we don't need it's features, though, then all its drawbacks kick in, to wit:
- dynamic initialisation causing program startup slowdown even if never used
- dynamic destruction causing program shutdown slowdown even if never used
- SIOF / SDOF
The staticMetaObject declared by Q_OBJECT and defined by the moc-generated code, otoh, is optimized for maximal sharing and minimal runtime initialisation.
The propertyOrdering member should also be given this kind of treatment.
Acceptance criteria:
- propertyOrdering is Q_CONSTINIT'able
- minimizes relocations to the minimum possible
- is trivially destructible, so it doesn't run code at program shutdown
A separate question is whether the json-name has to be stored in UTF-16, or whether UTF-8/US-ASCII aren't sufficient (halves string storage space).
Attachments
Issue Links
- clones
-
QTBUG-102176 QtProtobuf: Update documentation
- Closed