Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
6.10
-
None
Description
QFileSystemWatcher::addPath() is slow on my arm macbook. It causes a freeze in Qt Creator (QTCREATORBUG-33191) and I managed to construct a reproducer without Qt Creator, see attached zip.
The reproducer creates 1000 files in a temporary directory, watches the directory, then modifies the files in the temporary directory, and gets a directoryChanged signal (up to here everything good).
After receiving the directoryChanged signal, it will do QFileSystemWatcher::addPath().
Expected behavior: addPath() returns in a timely fashioin
Observed behavior: addPath() spends more than 6 seconds in FSEventStreamFlushSync()
I get following output from the reproducer:
[ 0.000] Creating files [ 0.099] Done! [ 0.099] Creating watch! [ 0.133] Done! [ 0.133] Running event loop! [ 0.184] Modifying folder! [ 0.244] Done! [ 0.251] Directory Changed! [ 0.251] Adding path in onDirectoryChanged [ 6.918] Done!
Note the 6 seconds difference between "Adding path in onDirectoryChanged" and "Done!".
Also note that in QTCREATORBUG-33191, the CMake extension actually watches a folder with ~9000 files when opening the qt project and building qtdeclarative, and there we wait for more than 6 seconds.
Attachments
Issue Links
- resulted from
-
QTCREATORBUG-33191 Freeze when reconfiguring CMake project
-
- In Progress
-
Gerrit Reviews
For Gerrit Dashboard: QTBUG-138374 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
659632,1 | QDirListing: check the flags before calling isSymLink() | dev | qt/qtbase | Status: NEW | 0 | 0 |
659633,1 | QFileSystemEngine/Darwin: cache the CFURLRef across multiple calls | dev | qt/qtbase | Status: NEW | 0 | 0 |
659634,1 | QFseventsFileSystemWatcher: switch to QDirListing with no filtering | dev | qt/qtbase | Status: NEW | 0 | 0 |