linux/tools/net/ynl/pyynl
Jakub Kicinski 07c4bca9d9 tools: ynl: try to avoid the very slow YAML loader
Turns out Python YAML defaults to a pure Python loader for YAML
files which is a lot slower than the C loader (using libyaml).
Try to use the C one whenever possible.

The avg time to run:
  $ tools/net/ynl/pyynl/cli.py --family tc --no-schema
drops from 300+ ms to 115 ms with this change (40 samples).

We could drop the load time further to 85 ms if we "compiled"
the specs to JSON. Slightly tricky parts are that we don't
currently install the specs at all on make install, so it's
unclear where to put the conversion. Also JSON has questionable
support for comments and we need an SPDX line.

Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Reviewed-by: Nicolai Buchwitz <nb@tipi-net.de>
Reviewed-by: Donald Hunter <donald.hunter@gmail.com>
Link: https://patch.msgid.link/20260603210810.2636193-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-06-04 15:36:12 -07:00
..
lib tools: ynl: try to avoid the very slow YAML loader 2026-06-04 15:36:12 -07:00
__init__.py
.gitignore
cli.py tools: ynl: rework policy access to support recursion 2026-03-18 16:41:42 -07:00
ynl_gen_c.py tools: ynl: add scope qualifier for definitions 2026-05-12 16:15:00 +02:00
ynl_gen_rst.py tools: ynl: fix pylint issues in ynl_gen_rst 2026-01-09 08:55:33 -08:00