ManimCommunity / ManimCommunity/manim

Reduce the time for CLI startup

Open
#1,766 2 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

needs discussion performance Suggestion
Dominant language
Python
Stars
40.9k
Forks
3.1k
Avg merge
3d 12h
Merged PRs (30d)
25

Description

Description of the proposed feature

Currently, when running manim executable or module using (py -m manim), the whole module is imported which is large and takes a lot of time. I propose to move all the CLI handling stuff (ie manim.cli) to a new module called manim_cli which would not import manim until the command line arguments are parsed. By doing so, we can reduce the startup time.

How can the new feature be used?

Reduce the time to load manim command. If someone just wanted to see the help this would reduce the time they wait because manim wouldn't be imported in that case.

Additional comments

We would need to move the main module to src structure for this to work.

src \
    - manim
    - manim_cli

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting the current manim executable and module entry points, especially manim.cli, and measure the existing startup time. Review how the package is laid out under src and determine how a separate manim_cli module could parse arguments before importing manim. Done means the CLI starts faster, including help output, while existing command behavior remains available.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.