Skip to content

chore: support lazy imports (Python 3.15+)#311

Merged
henryiii merged 2 commits intomainfrom
henryiii/fix/missingsubmodules
Mar 27, 2026
Merged

chore: support lazy imports (Python 3.15+)#311
henryiii merged 2 commits intomainfrom
henryiii/fix/missingsubmodules

Conversation

@henryiii
Copy link
Copy Markdown
Collaborator

@henryiii henryiii commented Mar 27, 2026

Python 3.15 lazy imports.

Before:

Benchmark 1: .venv/bin/python -m repo_review --help
  Time (mean ± σ):     113.3 ms ±  59.8 ms    [User: 83.5 ms, System: 19.2 ms]
  Range (min … max):    85.9 ms … 273.9 ms    10 runs

After:

Benchmark 1: .venv/bin/python -m repo_review --help
  Time (mean ± σ):      66.7 ms ±   1.8 ms    [User: 53.6 ms, System: 10.9 ms]
  Range (min … max):    64.1 ms …  70.9 ms    40 runs

If CPython Rich would implement lazy imports:

Benchmark 1: .venv/bin/python -X lazy_imports=all -m repo_review --help
  Time (mean ± σ):      45.7 ms ±   0.6 ms    [User: 36.6 ms, System: 6.9 ms]
  Range (min … max):    44.6 ms …  47.0 ms    60 runs

I got it down even further in #317.

@henryiii henryiii changed the title fix: some missing submodules chore: support lazy imports (Python 3.15+) Mar 27, 2026
@henryiii henryiii force-pushed the henryiii/fix/missingsubmodules branch from 6eb6e04 to 7b9451c Compare March 27, 2026 15:03
@henryiii henryiii merged commit 5f373c4 into main Mar 27, 2026
12 checks passed
@henryiii henryiii deleted the henryiii/fix/missingsubmodules branch March 27, 2026 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant