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

QFontMetricsF::horizontalAdvance seems to do unnecessary scanning

    XMLWordPrintable

Details

    • Linux/X11
    • 7c84550f3 (dev), 708a48a0b (6.5), 802dfb187 (6.4), 4d3daea33 (tqtc/lts-6.2), bea15cdfa (dev), cc473646e (6.5)

    Description

      For very long input strings, but still with limited length, it will scan the whole input for 0x9c. However it looks like it would use qMin() to limit it to the length anyway:

      https://code.qt.io/cgit/qt/qtbase.git/tree/src/gui/text/qfontmetrics.cpp#n496

      This scanning results in a performance issue in laying out some text which has very long lines, like some logs.

      Attachments

        Issue Links

          For Gerrit Dashboard: QTBUG-109838
          # Subject Branch Project Status CR V

          Activity

            People

              allan.jensen Allan Sandfeld Jensen
              poikelin Joni Poikelin
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews