diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-10-11 10:21:20 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-11-16 11:55:08 +0000 |
commit | 536b73f55f51fcea555338f9a557fe86c09d00cb (patch) | |
tree | f622e742a1bbcfc017d253869e1199b80d000a4e /bitbake/lib/bb/data_smart.py | |
parent | fb01a66f482a742805ea40fb2b7162b062b38021 (diff) | |
download | poky-536b73f55f51fcea555338f9a557fe86c09d00cb.tar.gz |
bitbake: 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.
(Bitbake rev: c9b9443faa76ee7366b1400a56f826f3f9dec1be)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/data_smart.py')
-rw-r--r-- | bitbake/lib/bb/data_smart.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bitbake/lib/bb/data_smart.py b/bitbake/lib/bb/data_smart.py index 70558c15aa..ca5774b26b 100644 --- a/bitbake/lib/bb/data_smart.py +++ b/bitbake/lib/bb/data_smart.py | |||
@@ -547,7 +547,7 @@ class DataSmart(MutableMapping): | |||
547 | # aka pay the cookie monster | 547 | # aka pay the cookie monster |
548 | override = var[var.rfind('_')+1:] | 548 | override = var[var.rfind('_')+1:] |
549 | shortvar = var[:var.rfind('_')] | 549 | shortvar = var[:var.rfind('_')] |
550 | while override: | 550 | while override and override.islower(): |
551 | if shortvar not in self.overridedata: | 551 | if shortvar not in self.overridedata: |
552 | self.overridedata[shortvar] = [] | 552 | self.overridedata[shortvar] = [] |
553 | if [var, override] not in self.overridedata[shortvar]: | 553 | if [var, override] not in self.overridedata[shortvar]: |
@@ -621,7 +621,7 @@ class DataSmart(MutableMapping): | |||
621 | if '_' in var: | 621 | if '_' in var: |
622 | override = var[var.rfind('_')+1:] | 622 | override = var[var.rfind('_')+1:] |
623 | shortvar = var[:var.rfind('_')] | 623 | shortvar = var[:var.rfind('_')] |
624 | while override: | 624 | while override and override.islower(): |
625 | try: | 625 | try: |
626 | if shortvar in self.overridedata: | 626 | if shortvar in self.overridedata: |
627 | # Force CoW by recreating the list first | 627 | # Force CoW by recreating the list first |