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

QFileSystemWatcher::addPath() is slow on macos

XMLWordPrintable

    • ebfcc7e74 (dev), fb96e015a (dev), 0276329e9 (dev), 6755cf822 (6.10), e83b27813 (6.10), 81c89dc5e (6.10), cca6eb1da (6.9), 700c498dd (6.9), 620d85cbc (6.9), 9081bf1dc (tqtc/lts-6.8), e71106b6b (tqtc/lts-6.8), ac0b712e0 (tqtc/lts-6.8)

      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.

        1. Archive.zip
          1 kB
          Sami Shalayel
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            thiago Thiago Macieira
            sami.shalayel Sami Shalayel
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: