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

QFontMetricsF::horizontalAdvance seems to do unnecessary scanning

XMLWordPrintable

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

      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.

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

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

              Created:
              Updated:
              Resolved: