diff options
| author | Robert Yang <liezhi.yang@windriver.com> | 2024-07-27 20:39:31 -0700 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-08-03 11:37:47 +0100 |
| commit | 6568b7aac5493d17ceaf8a9e9e553cce46b026f3 (patch) | |
| tree | e1475b5c4b6d7b0c38f364735c075858f41ecc5b /bitbake/lib | |
| parent | 0c824d80712ba24bf3a6771b324492657b7b26f8 (diff) | |
| download | poky-6568b7aac5493d17ceaf8a9e9e553cce46b026f3.tar.gz | |
bitbake: data_smart: Improve performance for VariableHistory
Fixed:
- BBMULTICONFIG = "qemux86-64 qemuarm64" and more than 70 layers in BBLAYERS
$ bitbake -p -P
Check profile.log.processed, the record() cost more than 20 seconds, it is less
than 1 second when multiconfig is not enabled, and there would be the following
error when more muticonfigs are enabled:
Timeout while waiting for a reply from the bitbake server
Don't change the type of loginfo['detail'] or re-assign it can make record()
back to less than 1 second, this won't affect COW since loginfo is a mutable
type.
The time mainly affected by two factors:
1) The number of enabled layers, nearly 1 second added per layer when the
number is larger than 50.
2) The global var such as USER_CLASSES, about 1 ~ 2 seconds added per layer
when the layers number is larger than 50.
(Bitbake rev: 0596aa0d5b0e4ed3db11b5bd560f1d3439963a41)
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
| -rw-r--r-- | bitbake/lib/bb/data_smart.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/bitbake/lib/bb/data_smart.py b/bitbake/lib/bb/data_smart.py index 0128a5bb17..c6049d578e 100644 --- a/bitbake/lib/bb/data_smart.py +++ b/bitbake/lib/bb/data_smart.py | |||
| @@ -272,12 +272,9 @@ class VariableHistory(object): | |||
| 272 | return | 272 | return |
| 273 | if 'op' not in loginfo or not loginfo['op']: | 273 | if 'op' not in loginfo or not loginfo['op']: |
| 274 | loginfo['op'] = 'set' | 274 | loginfo['op'] = 'set' |
| 275 | if 'detail' in loginfo: | ||
| 276 | loginfo['detail'] = str(loginfo['detail']) | ||
| 277 | if 'variable' not in loginfo or 'file' not in loginfo: | 275 | if 'variable' not in loginfo or 'file' not in loginfo: |
| 278 | raise ValueError("record() missing variable or file.") | 276 | raise ValueError("record() missing variable or file.") |
| 279 | var = loginfo['variable'] | 277 | var = loginfo['variable'] |
| 280 | |||
| 281 | if var not in self.variables: | 278 | if var not in self.variables: |
| 282 | self.variables[var] = [] | 279 | self.variables[var] = [] |
| 283 | if not isinstance(self.variables[var], list): | 280 | if not isinstance(self.variables[var], list): |
| @@ -336,7 +333,8 @@ class VariableHistory(object): | |||
| 336 | flag = '[%s] ' % (event['flag']) | 333 | flag = '[%s] ' % (event['flag']) |
| 337 | else: | 334 | else: |
| 338 | flag = '' | 335 | flag = '' |
| 339 | o.write("# %s %s:%s%s\n# %s\"%s\"\n" % (event['op'], event['file'], event['line'], display_func, flag, re.sub('\n', '\n# ', event['detail']))) | 336 | o.write("# %s %s:%s%s\n# %s\"%s\"\n" % \ |
| 337 | (event['op'], event['file'], event['line'], display_func, flag, re.sub('\n', '\n# ', str(event['detail'])))) | ||
| 340 | if len(history) > 1: | 338 | if len(history) > 1: |
| 341 | o.write("# pre-expansion value:\n") | 339 | o.write("# pre-expansion value:\n") |
| 342 | o.write('# "%s"\n' % (commentVal)) | 340 | o.write('# "%s"\n' % (commentVal)) |
| @@ -390,7 +388,7 @@ class VariableHistory(object): | |||
| 390 | if isset and event['op'] == 'set?': | 388 | if isset and event['op'] == 'set?': |
| 391 | continue | 389 | continue |
| 392 | isset = True | 390 | isset = True |
| 393 | items = d.expand(event['detail']).split() | 391 | items = d.expand(str(event['detail'])).split() |
| 394 | for item in items: | 392 | for item in items: |
| 395 | # This is a little crude but is belt-and-braces to avoid us | 393 | # This is a little crude but is belt-and-braces to avoid us |
| 396 | # having to handle every possible operation type specifically | 394 | # having to handle every possible operation type specifically |
