mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-06-21 15:43:21 +02:00
07c4bca9d9
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>