diff options
author | 2015-04-10 15:57:05 +0100 | |
---|---|---|
committer | 2015-04-11 16:21:48 +0100 | |
commit | 763bff1f2210734c189f44478466125c3ce0a8b2 (patch) | |
tree | 3330aa1c09107f252a73e02c00eee9d630384f80 | |
parent | 0d1f75b9d67aa796a14be115e9f04d5d6247ce40 (diff) | |
download | poky-763bff1f2210734c189f44478466125c3ce0a8b2.tar.gz poky-763bff1f2210734c189f44478466125c3ce0a8b2.tar.bz2 poky-763bff1f2210734c189f44478466125c3ce0a8b2.zip |
bitbake: cooker: Improve pyinotify performance
Benchmarks show that the introduction of pyinotify regressed
performance. This patch ensures we only call the add_watch() function
for new entries, not ones we've already processed which does improve
performance as measured by "time bitbake -p".
This doesn't completely remove the overhead but it does substantially
reduce it.
(Bitbake rev: 493361f35f6cc332d4ea359a2695622c2c91a9c2)
(Bitbake rev: f668b347a8f9563f41d454288b9d4632190f308f)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | bitbake/lib/bb/cooker.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py index e965bcc440..3909dc09f7 100644 --- a/bitbake/lib/bb/cooker.py +++ b/bitbake/lib/bb/cooker.py @@ -122,11 +122,13 @@ class BBCooker: self.configuration = configuration self.configwatcher = pyinotify.WatchManager() + self.configwatcher.bbseen = [] self.confignotifier = pyinotify.Notifier(self.configwatcher, self.config_notifications) self.watchmask = pyinotify.IN_CLOSE_WRITE | pyinotify.IN_CREATE | pyinotify.IN_DELETE | \ pyinotify.IN_DELETE_SELF | pyinotify.IN_MODIFY | pyinotify.IN_MOVE_SELF | \ pyinotify.IN_MOVED_FROM | pyinotify.IN_MOVED_TO self.watcher = pyinotify.WatchManager() + self.watcher.bbseen = [] self.notifier = pyinotify.Notifier(self.watcher, self.notifications) @@ -180,7 +182,7 @@ class BBCooker: if not watcher: watcher = self.watcher for i in deps: - f = os.path.dirname(i[0]) + f = i[0] if f in watcher.bbseen: continue watcher.bbseen.append(f) @@ -194,6 +196,7 @@ class BBCooker: except pyinotify.WatchManagerError as e: if 'ENOENT' in str(e): f = os.path.dirname(f) + watcher.bbseen.append(f) continue raise |