2021-10-18 10:57:00

by Geert Uytterhoeven

[permalink] [raw]
Subject: [PATCH 0/2] dt-bindings: Improve yamllint performance

Hi Rob,

This series improves yamllint performance by parallelizing the
operation, and by restricting the checked files to those specified using
DT_SCHEMA_FILES.

Changes compared to v1:
- New patch to parallelize yamllint,
- Introduce find_all_cmd,
- Only use the restricted set for yamllint.

I've been using this for the past 6 months, as it helps a lot when
writing or updating DT bindings. Combined, this reduces the execution
time of

make dt_binding_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/your/binding/file.yaml

from ca. 30 to 10 s on i7-8700K.

Thanks for your comments!

Geert Uytterhoeven (2):
dt-bindings: Parallelize yamllint
dt-bindings: Consider DT_SCHEMA_FILES when finding all json-schema

Documentation/devicetree/bindings/Makefile | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)

--
2.25.1

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds


2021-10-18 10:57:01

by Geert Uytterhoeven

[permalink] [raw]
Subject: [PATCH 1/2] dt-bindings: Parallelize yamllint

Use xargs sharding like "chk_bindings" does, to parallelize the
execution of yamllint.

This reduces the yamllint execution time from ca. 21 to 5 seconds on
i7-8700K.

Suggested-by: Rob Herring <[email protected]>
Signed-off-by: Geert Uytterhoeven <[email protected]>
---
v2:
- New.
---
Documentation/devicetree/bindings/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/Makefile b/Documentation/devicetree/bindings/Makefile
index a072e95de626c83b..6305cfa9495ed676 100644
--- a/Documentation/devicetree/bindings/Makefile
+++ b/Documentation/devicetree/bindings/Makefile
@@ -28,7 +28,7 @@ find_cmd = find $(srctree)/$(src) \( -name '*.yaml' ! \

quiet_cmd_yamllint = LINT $(src)
cmd_yamllint = ($(find_cmd) | \
- xargs $(DT_SCHEMA_LINT) -f parsable -c $(srctree)/$(src)/.yamllint >&2) || true
+ xargs -n200 -P$$(nproc) $(DT_SCHEMA_LINT) -f parsable -c $(srctree)/$(src)/.yamllint >&2) || true

quiet_cmd_chk_bindings = CHKDT $@
cmd_chk_bindings = ($(find_cmd) | \
--
2.25.1

2021-10-20 18:01:14

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATCH 1/2] dt-bindings: Parallelize yamllint

On Mon, 18 Oct 2021 12:54:47 +0200, Geert Uytterhoeven wrote:
> Use xargs sharding like "chk_bindings" does, to parallelize the
> execution of yamllint.
>
> This reduces the yamllint execution time from ca. 21 to 5 seconds on
> i7-8700K.
>
> Suggested-by: Rob Herring <[email protected]>
> Signed-off-by: Geert Uytterhoeven <[email protected]>
> ---
> v2:
> - New.
> ---
> Documentation/devicetree/bindings/Makefile | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>

Applied, thanks!