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

Performance regression in QDirIterator when going from 6.5.3 to 6.8.2 [REG 6.5.3->6.8.2]

    XMLWordPrintable

Details

    • Windows
    • 606ba1050 (dev), 23d97f756 (6.9), f7dd31755 (6.8)

    Description

      QDirIterator has become significantly slower in Qt 6.8.2, relative to Qt 6.5.3. The new version is on the order of 4-5 times slower than the previous version.  I understand that QDirIterator is now wrapping the new QDirListing class, and it appears that the QDirListing class is doing a lot more work than the previous QDirIterator native Impl.

      Additional information is available via my post at the Qt forum...
      https://forum.qt.io/topic/161349/qdiriterator-much-slower-on-qt-6-8

      My wild guess would be that perhaps QDirListing should not be calling GetFileAttributesExW for each item in the iterator, instead only calling FindNextFileW? However I have no real insight I'm just guessing about an optimal design and comparing a superliminal capture form 6.5.3 and comparing it to 6.8.2

       

      Repro steps:

      Execute the a QDirIterator similar to..

      QHash<QString, MyFileUtil::FileStat> result;
          for(QDirIterator it(sourcePath, QDir::Files, QDirIterator::Subdirectories); it.hasNext(); )
          {
              it.next();
              result.insert(it.filePath(), MyFileUtil::FileStat(it.fileInfo()));
          } 

      Where

      MyFileUtil::FileStat(const QFileInfo& fileInfo)
          : mSize(fileInfo.size())
          , mLastModified(fileInfo.lastModified().toMSecsSinceEpoch())
      {} 

      on 6.5.3 and 6.8.2.

      The 6.8.2 version will end up being around 5 times slower than the 6.5.3 version, even removing the construction of the FileStat object is possible to reduce the total amount of work being done.

      Attachments

        Issue Links

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

          Activity

            People

              thiago Thiago Macieira
              james_fmod James Wise
              Votes:
              1 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes