aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bb/build.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2012-08-15 16:57:47 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-08-16 11:16:39 +0100
commit769b694eeb617bb793bd79d0d7b29c43d2646ece (patch)
tree29771d4de3cef6a1f248531c4be02a8ce72bafbd /lib/bb/build.py
parent53efa01720a61da2cb344cbb7e977baa28deba3b (diff)
downloadbitbake-769b694eeb617bb793bd79d0d7b29c43d2646ece.tar.gz
build.py: Only execute mkdirhier if stampdir doesn't exist
I noticed this was showing up on profile logs as a sigificant time user in "bitbake bash" when bash was already built. It reduces the time from 5.2 to 4.5 seconds in my test environment. We make use of the parser's mtime cache as once a directory exists, we can assume it continues to exist and this avoids syscalls. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/build.py')
-rw-r--r--lib/bb/build.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/bb/build.py b/lib/bb/build.py
index bea292608..d64077ea9 100644
--- a/lib/bb/build.py
+++ b/lib/bb/build.py
@@ -464,7 +464,9 @@ def stamp_internal(taskname, d, file_name):
stamp = bb.parse.siggen.stampfile(stamp, file_name, taskname, extrainfo)
- bb.utils.mkdirhier(os.path.dirname(stamp))
+ stampdir = os.path.dirname(stamp)
+ if bb.parse.cached_mtime_noerror == 0:
+ bb.utils.mkdirhier(stampdir)
return stamp