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

chore(lib): reduce import overhead #147

Merged
merged 6 commits into from
Mar 8, 2023
Merged

chore(lib): reduce import overhead #147

merged 6 commits into from
Mar 8, 2023

Conversation

jeertmans
Copy link
Owner

@jeertmans jeertmans commented Mar 6, 2023

This PR should reduce the import time overhead caused by manim imports. To solve this, manim is only imported when Slide or ThreeDSlide is needed. A custom logger is now defined, which copies the one from Manim Community. FFMPEG_BIN is now hardcoded, but should be configurable in the future via the CLI or some config file.

Closes #146

NOTE: this reduces CLI launching time from ~4.0s to ~2.0s.

This PR should reduce the import time overhead caused by manim imports. To solve this, manim is only imported when Slide or ThreeDSlide is needed. A custom logger is now defined, which copies the one from Manim Community. FFMPEG_BIN is now hardcoded, but should be configurable in the future via the CLI or some config file.
@jeertmans jeertmans added dependencies Pull requests that update a dependency file enhancement New feature or request labels Mar 6, 2023
@jeertmans jeertmans temporarily deployed to github-pages March 6, 2023 10:05 — with GitHub Actions Inactive
@jeertmans jeertmans temporarily deployed to github-pages March 8, 2023 10:10 — with GitHub Actions Inactive
@jeertmans jeertmans merged commit 700584c into main Mar 8, 2023
@jeertmans jeertmans deleted the import-time branch March 8, 2023 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] faster (or lazy) module import
1 participant