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

Certain decorators perform extremely slow function inspection every call #2094

Open
bzczb opened this issue Jan 13, 2024 · 0 comments · May be fixed by #2095
Open

Certain decorators perform extremely slow function inspection every call #2094

bzczb opened this issue Jan 13, 2024 · 0 comments · May be fixed by #2095
Labels
bug Issues that report (apparent) bugs. performance Speed/performance of code or individual functionality.

Comments

@bzczb
Copy link

bzczb commented Jan 13, 2024

In decorators.py, preprocess_args() and use_clip_fps_by_default() do function inspection on their decorated function every time the wrapped function is called. This causes extreme performance issues. On my system a large majority of the time rendering audio, something like 70% or 80%, is spent runninginspect.getfullargspec() on the same functions.

Expected Behavior

The decorators only compute their wrapped function's arguments once.

Actual Behavior

The decorators compute their wrapped function's arguments every time the wrapped function is called.

Steps to Reproduce the Problem

In a Python debugger, render anything in MoviePy. Set a breakpoint inside the decorator wrappers and observe.

Specifications

  • Python Version: 3.12
  • MoviePy Version: master (2.0.0.dev2)
  • Platform: Windows 10
@bzczb bzczb added the bug Issues that report (apparent) bugs. label Jan 13, 2024
@bzczb bzczb linked a pull request Jan 13, 2024 that will close this issue
@keikoro keikoro added the performance Speed/performance of code or individual functionality. label Feb 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues that report (apparent) bugs. performance Speed/performance of code or individual functionality.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants