diff options
| author | Ulf Magnusson <ulfalizer@gmail.com> | 2018-07-11 10:25:41 +0200 |
|---|---|---|
| committer | Ulf Magnusson <ulfalizer@gmail.com> | 2018-07-11 14:55:25 +0200 |
| commit | 71872a88641f713dfa986906e860c320a74fd84a (patch) | |
| tree | 0249602317d3ce2c6f73b2c015c01e84d534ef26 /allyesconfig.py | |
| parent | f0a8a4d86e4c52b401f543737d76ae8392247300 (diff) | |
Massively speed up U-Boot parsing
U-Boot has a ton of definition locations for some symbols, causing a lot
of redundant work when iterating over Kconfig.defined_syms in
_build_dep(). Iterate over set(Kconfig.defined_syms) instead, wherever
possible.
This speeds up the U-Boot parsing time from 4 seconds to 0.6 seconds on
my machine.
Also update the bundled tools to iterate over set(Kconfig.defined_syms).
The performance loss is negligible even for projects that don't use
multiple definition locations.
Update the documentation to clarify that symbols/choices defined in
multiple locations appear multiple times in Kconfig.defined_syms/choices
as well.
Diffstat (limited to 'allyesconfig.py')
| -rwxr-xr-x | allyesconfig.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/allyesconfig.py b/allyesconfig.py index bf7ca51..5fe8b46 100755 --- a/allyesconfig.py +++ b/allyesconfig.py @@ -44,7 +44,10 @@ def main(): # # Assigning 0/1/2 to non-bool/tristate symbols has no effect (int/hex # symbols still take a string, because they preserve formatting). - for sym in kconf.defined_syms: + # + # The set() speeds things up for projects that use multiple definition + # locations a lot + for sym in set(kconf.defined_syms): # Set choice symbols to 'm'. This value will be ignored for choices in # 'y' mode (the "normal" mode), which will instead just get their # default selection, but will set all symbols in m-mode choices to 'm', |
