Details
-
Bug
-
Resolution: Fixed
-
Not Evaluated
-
6.8.2
-
None
-
Windows 10, MSVC 2022.
-
-
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
- relates to
-
QTBUG-134740 [REG 6.7.3 -> 6.8.0] QDir::entryInfoList slower accessing SMB share from macOS
-
- Open
-
For Gerrit Dashboard: QTBUG-134699 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
631933,4 | QDirListing/Win: improve performance by setting WinLnkType earlier | dev | qt/qtbase | Status: MERGED | +2 | +1 |
632043,2 | QDirListing/Win: improve performance by setting WinLnkType earlier | 6.9 | qt/qtbase | Status: MERGED | +2 | 0 |
632055,2 | QDirListing/Win: improve performance by setting WinLnkType earlier | 6.8 | qt/qtbase | Status: MERGED | +2 | 0 |