Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't import not used commands modules #2714

Merged
merged 1 commit into from Dec 30, 2021

Conversation

mondeja
Copy link
Contributor

@mondeja mondeja commented Dec 18, 2021

As you can see in the next image, when you run mkdocs build, serve, gh_deploy and new modules commands are also imported, although they are not used:

not-used-commands

Created with pyinstrument -o out.html -r html -m mkdocs -- build

These imports add some initialization time to the build because some dependencies like watchdog must be initialized. This PR solves it moving the imports to their respective functions.

Copy link
Contributor

@oprypin oprypin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@oprypin oprypin merged commit 4a6862a into mkdocs:master Dec 30, 2021
@mondeja mondeja deleted the no-import-unused-commands branch December 31, 2021 11:38
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.

None yet

2 participants