diff options
| author | Christian Breunig <christian@breunig.cc> | 2026-08-30 13:40:39 +0200 |
|---|---|---|
| committer | Christian Breunig <christian@breunig.cc> | 2026-08-30 13:40:39 +0200 |
| commit | 6c80440b0711b8f1e0a713df4f097ab1902163cd (patch) | |
| tree | cb6bb5f1afd35769a7f60dcbbfec060ea4366439 /src/migration-scripts/system | |
| parent | b9fd27b511d22554f294e87e9349456b3418bb2b (diff) | |
| download | vyos-1x-6c80440b0711b8f1e0a713df4f097ab1902163cd.tar.gz vyos-1x-6c80440b0711b8f1e0a713df4f097ab1902163cd.zip | |
vyos: T9261: defer heavy imports out of the Config/ConfigSession path
Importing vyos.config dragged in the whole HTTP and crypto stack. vyos.version
imported requests and urllib3 for get_remote_version(), plus vyos.system.image
for a single call in get_full_version_data() - and that reaches vyos.system.grub
and vyos.template, so every consumer paid for jinja2 as well. vyconf_session
imported vyos.remote, and therefore paramiko and cryptography, for a
get_config_file() used in two methods. All of these move to their call sites.
vyos/utils/__init__.py eagerly imported all 18 submodules, so 'from
vyos.utils.dict import get_sub_dict' also loaded auth, network and process.
It now resolves them on first attribute access via a module-level __getattr__.
No caller relied on the eager import; the common 'from vyos.utils.<sub> import
<name>' form is unaffected.
import vyos.config 129.6 -> 47.7 ms (-63%, 2.7x), 575 -> 194 modules
import vyos.ifconfig 205.0 -> 149.7 ms (-27%, 1.4x)
This is per process, so it is paid again by every conf-mode script not handled
in-daemon by vyos-configd, every op-mode script, and every smoketest.
Diffstat (limited to 'src/migration-scripts/system')
0 files changed, 0 insertions, 0 deletions
