aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2015-10-11 10:21:20 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-11-16 11:48:50 +0000
commitc9b9443faa76ee7366b1400a56f826f3f9dec1be (patch)
tree84586e53fff48407f732c494f32bac561b5a1fe1
parent37214ea9bf484998b75dbc1200d53f1afc5257ed (diff)
downloadbitbake-c9b9443faa76ee7366b1400a56f826f3f9dec1be.tar.gz
data_smart: Only support lowercase OVERRIDES
Our current OVERRIDES handling means we end up caching and checking for a lot of possible override combinations which turn out to very unlikely. A typical example is the SRC_URI variable where we have to check if "URI" is an override. Having spent many hours working in this code, I've realised all the actual overrides we use are lower case and our standard variables are mostly uppercase. This means we could gain quite some speed advantage if we write this into the code, that overrides only consist of lowercase characters. This patch shows how simple this is and the resulting speed gains are significant. This is a significant change but tests show we don't appear to have any users of capitals in overrides in any OE-Core metadata. Before "time bitbake -p": real 2m4.224s user 7m32.312s sys 0m7.116s After "time bitbake -p": real 1m26.009s user 5m10.484s sys 0m4.640s This check could also be made conditional however I'm not seeing a need to do that at present. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--lib/bb/data_smart.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/bb/data_smart.py b/lib/bb/data_smart.py
index 70558c15a..ca5774b26 100644
--- a/lib/bb/data_smart.py
+++ b/lib/bb/data_smart.py
@@ -547,7 +547,7 @@ class DataSmart(MutableMapping):
# aka pay the cookie monster
override = var[var.rfind('_')+1:]
shortvar = var[:var.rfind('_')]
- while override:
+ while override and override.islower():
if shortvar not in self.overridedata:
self.overridedata[shortvar] = []
if [var, override] not in self.overridedata[shortvar]:
@@ -621,7 +621,7 @@ class DataSmart(MutableMapping):
if '_' in var:
override = var[var.rfind('_')+1:]
shortvar = var[:var.rfind('_')]
- while override:
+ while override and override.islower():
try:
if shortvar in self.overridedata:
# Force CoW by recreating the list first