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

Consider packing languageCodeList tighter

    XMLWordPrintable

Details

    • Task
    • Resolution: Fixed
    • P3: Somewhat important
    • 6.6.0
    • None
    • Core: Locales (i18n)
    • None
    • 3
    • 3dcd6b7ec (dev)
    • Foundation Sprint 74, Foundation Sprint 75, Foundation Sprint 76, Foundation Sprint 77

    Description

      There seem to be quite some opportunities to pack some of the arrays that contain locale data more tightly.

      1. The AlphaCode struct is a char[4] for, but only ever holds [a-z]{,3}, which fits into 16 bits, halving the size of an AlphaCode struct. The languageCodeList is currently >5KiB in size, so we'd save 2.5KiB on this alone.
        • There is also quite some repetition of 3LCs in that area, but with the above change, any index would have to be 16-bit, too, so would actually increase the size again
        • alternatively, to keep the easy conversion to QL1SV, can pack them into char[3]'s, reducing one languageCodeList entry from 16B to 12B.
      2. TerritoryLanguage is currently 8B in size, but the languageId and territoryId both fit into 9-bit fields, leaving ample space in a 32-bit bitfield for the `system`.
      3. to be continued...

      Attachments

        Issue Links

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

          Activity

            People

              mate Máté Barany
              mmutz Marc Mutz
              Vladimir Minenko Vladimir Minenko
              Alex Blasche Alex Blasche
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes