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

QFileSystemModelPrivate::_q_directoryChanged get executed too frenquently which result in the performance issue

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P1: Critical
    • None
    • 5.15.6, 5.15.7
    • None
    • Windows

    Description

      In my application there is a file management feature. I use QFileSytemModel to map filesystem from windows, and QListView to display it on UI.

      when copy 1000 elements(200 folders + 800 files) from one folder to another folder, there will be a big performance issue on QFileSytemModel. As long as one path is watched, even i do copy past on windows on this path, UI still get freezed. Thounds of _q_directoryChanged  are queued for executing and block the whole application.

      i think the root cause are:

      1. QFileInfoGatherer running on a separate thread, _q_directoryChanged  running on main thread. they are connected in the following way:q->connect(&fileInfoGatherer, SIGNAL(updates(QString,QVector<QPair<QString,QFileInfo> >)),
      q, SLOT(_q_fileSystemChanged(QString,QVector<QPair<QString,QFileInfo> >)));

      During the _q_directoryChanged  excuting, it will block the ui.

      2. the updates signal was emit too frequent than expected during copy. QFileInfoGatherer::getFileInfos executes around every 200ms, but each time it may emit several updates signal

       

       

      Attachments

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

        Activity

          People

            thiago Thiago Macieira
            harmuchi Lu Jinjun
            Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes