Browse Source
The motivation for this patch was to improve the script's performance, but some stylistic changes and cleanups are included as well. The main optimization concerns the use of PyYAML, as it offers multiple functions for interpreting YAML. The commonly used `load`/`safe_load` converts a YAML stream to a dictionary. There are also `scan`, `parse`, and `compose`, which return intermediate representations, the last one being a graph. [1] Since `gen_driver_kconfig_dts` scans DT bindings for compatible strings, it only needs to look through top level keys in YAML. The intermediate PyYAML graph is sufficient for this, and using it reduces the script's execution time by about 30%, without making the code too complicated. [1] - https://pyyaml.org/wiki/PyYAMLDocumentation Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>pull/84193/head
1 changed files with 37 additions and 45 deletions
Loading…
Reference in new issue