From 71872a88641f713dfa986906e860c320a74fd84a Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Wed, 11 Jul 2018 10:25:41 +0200 Subject: 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. --- allmodconfig.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'allmodconfig.py') diff --git a/allmodconfig.py b/allmodconfig.py index b8f792a..a7804b3 100755 --- a/allmodconfig.py +++ b/allmodconfig.py @@ -25,7 +25,9 @@ def main(): BOOL = kconfiglib.BOOL TRISTATE = kconfiglib.TRISTATE - 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): if sym.orig_type == BOOL: # 'bool' choice symbols get their default value, as determined by # e.g. 'default's on the choice -- cgit v1.2.3