[bitbake-devel] [RFC PATCH] data_smart: Only support lowercase OVERRIDES

Richard Purdie richard.purdie at linuxfoundation.org
Sun Oct 11 09:21:20 UTC 2015


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 at linuxfoundation.org>
---
 bitbake/lib/bb/data_smart.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/bitbake/lib/bb/data_smart.py b/bitbake/lib/bb/data_smart.py
index 0b8811b..1d5cc8c 100644
--- a/bitbake/lib/bb/data_smart.py
+++ b/bitbake/lib/bb/data_smart.py
@@ -543,7 +543,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]:
@@ -617,7 +617,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





More information about the bitbake-devel mailing list