Skip to content

Move imports in main so that '--help' returns much faster - #455

Closed
afcollins wants to merge 1 commit into
cloud-bulldozer:mainfrom
afcollins:faster-help
Closed

Move imports in main so that '--help' returns much faster#455
afcollins wants to merge 1 commit into
cloud-bulldozer:mainfrom
afcollins:faster-help

Conversation

@afcollins

Copy link
Copy Markdown
Member

Type of change

  • Optimization

Description

orion --help takes too long for what it is meant to do. It should respond instantly.

The source of the delay is loading all the modules.

This moves the modules to be lazily imported on the functions where they are used.

Checklist before requesting a review

  • I have performed a self-review of my code.
  • If it is a core feature, I have added thorough tests.

Testing

$ time orion --help
Usage: orion [OPTIONS]
...
orion --help  0.11s user 0.04s system 85% cpu 0.177 total

Tests pass:

$ make test                                                                                                                                                                                                                                                                  
...
collected 254 items                                                                                                                                                                                                                                                         
...
254 passed, 4 warnings in 2.03s

@openshift-ci

openshift-ci Bot commented Aug 4, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign chentex for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 92d1e934-9610-4e85-bd01-d8eca6e2dc17

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@jtaleric

Copy link
Copy Markdown
Member

yeah, i figured lint would have a field day with this.

not opposed to the change, but we might need to ignore some more linting.

Signed-off-by: Andrew Collins <ancollin@redhat.com>
@afcollins

Copy link
Copy Markdown
Member Author

Yeah, good call. I have a less-invasive idea of simply putting the --help output in the readme, verbatim. Then we could keep it up to date in an automated way.

@afcollins afcollins closed this Aug 19, 2026
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.

2 participants