Changeset 602


Ignore:
Timestamp:
Feb 25, 2010, 12:03:04 AM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

corelib: QFileSystemWatcher: In the fall-back polling watcher, increased the sleep time between checks of all watched files from 1 second to 3 seconds to decrease the CPU load on big sets of watched files. Also, replaced the sleep between checking individual items with the yield call as it doesn't give significant improvement but just causes more CPU cycles to be spent between each check.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/corelib/io/qfilesystemwatcher.cpp

    r561 r602  
    7272{
    7373    enum {
    74         SmallPollingInterval = 50,  // time to wait after checking each watched
    75                                     // item, ms
    76         BigPollingInterval = 1000,  // time to wait after checking all watched
    77                                     // items, ms
     74        PollingInterval = 3000, // time to wait after checking all watched items, ms
    7875    };
    7976
     
    159156                emit fileChanged(path, false);
    160157            }
    161             waitCond.wait(&mutex, SmallPollingInterval);
     158            );
    162159        }
    163160        QMutableHashIterator<QString, FileInfo> dit(directories);
     
    175172                emit directoryChanged(path, false);
    176173            }
    177             waitCond.wait(&mutex, SmallPollingInterval);
     174            );
    178175        }
    179176        if (!startOver && !askedToFinish) {
    180             waitCond.wait(&mutex, BigPollingInterval);
     177            waitCond.wait(&mutex, PollingInterval);
    181178        }
    182179        if (askedToFinish) {
Note: See TracChangeset for help on using the changeset viewer.