Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-103914

QtProtobuf: make static const propertyOrdering constinit'able

    XMLWordPrintable

Details

    • Task
    • Resolution: Fixed
    • P2: Important
    • None
    • None
    • Core: Other
    • All
    • 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:

      1. dynamic initialisation causing program startup slowdown even if never used
      2. dynamic destruction causing program shutdown slowdown even if never used
      3. 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

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              manordheim MÃ¥rten Nordheim
              mmutz Marc Mutz
              Vladimir Minenko Vladimir Minenko
              Alex Blasche Alex Blasche
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes