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

Huge performance loss in Qt 5 when locale-aware sorting a QStringList

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.3.0 RC1
    • 5.2.0
    • Core: Locales (i18n)
    • None
    • Callgrind points to QCollator. See attached main.cpp.

    Description

      In Qt 4 when I inserted some (20 000+) rows into a QTreeWidget or QTableWidget and enabled sorting, it never took more than a second to display that amount of data.

      Now, on Qt 5 the very same code executes in 10 seconds on a Core i7.

      I attach a sample code (qmake && make) which contains a random string list which gets loaded into a QTreeWidget. Then gets sorted.

      In Qt 4.8.1 I get the following output:
      Textfile read in 12 ms
      Items inserted into the table in 1105 ms
      Items sorted in 303 ms

      In Qt 5.2:
      Textfile read in 6 ms
      Items inserted into the table in 58 ms
      Items sorted in 9169 ms

      This is a huge performance decline.

      Attachments

        1. main.cpp
          1.0 kB
        2. qt-sorting-bug.tar.xz
          591 kB

        Issue Links

          Activity

            People

              laknoll Lars Knoll
              szotsaki Szőts Ákos
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: