#10405 feat: Use lazy imports in the Meltano CLI (Python 3.15+)
Pull request opened by
edgarrmondragon on <!date^1792429608^{date_short}|2026-10-19T17:06:48Z>
Description
$ hyperfine \
--warmup 3 --min-runs 20 \
-n "No Lazy" --prepare 'uv venv -c -p 3.14 .venv && uv pip install --python .venv/bin/python .' ".venv/bin/meltano --help" \
-n "Lazy" --prepare 'uv venv -c -p 3.15 .venv && uv pip install --python .venv/bin/python .' ".venv/bin/meltano --help"
Benchmark 1: No Lazy (20 runs)
mean ± σ min … max
Wall Time [s] 5.183 ± 0.238 4.859 … 5.731
Memory [MiB] 115.5 ± 3.5 106.6 … 120.6
Benchmark 2: Lazy (20 runs)
mean ± σ min … max
Wall Time [s] 4.234 ± 0.163 3.969 … 4.508 -18.3%
Memory [MiB] 107.1 ± 3.3 101.5 … 112.8 -7.3%
Checklist
• I have read the
contribution guide
Was generative AI tooling used to co-author this PR?
No
Related Issues
• Closes #XXXX
Summary by Sourcery
Improve Meltano CLI startup performance on Python 3.15+ by enabling lazy imports and tracking import-time regressions.
New Features:
• Add Python 3.15+ lazy-import support across Meltano CLI modules to reduce startup overhead.
• Add CodSpeed import benchmarks for the CLI and version command.
Enhancements:
• Reduce CLI startup time and memory usage by deferring nonessential imports.
CI:
• Improve benchmark workflow change detection, required-job handling, and merge queue integration.
Tests:
• Add automated import performance measurement alongside existing benchmarks.
meltano/meltano