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

QFontMetrics unusable in multithreaded applications

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: 5.15
    • Fix Version/s: None
    • Component/s: GUI: Font handling
    • Labels:
      None
    • Platform/s:
      Linux/X11

      Description

      When QFontMetrics class methods (and maybe a lot of more stuff as the problem goes down to QFontPrivate) are used in an multithreaded environment (for example using QtConcurrent), there is a font database (re)load on every thread context switch! At least on Linux/X11 this is extremely slow and makes the application perform by orders of magnitude slower than without multithreading.

      The root of the problem is QFontPrivate::engineForScript(int script) const, respectively the global QFontCache it uses and drops on every thread context switch.

        Attachments

          Issue Links

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

            Activity

              People

              Assignee:
              esabraha Eskil Abrahamsen Blomfeldt
              Reporter:
              tumic Martin Tůma
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:

                  Gerrit Reviews

                  There are no open Gerrit changes