Zulko / moviepy

Video editing with Python
https://zulko.github.io/moviepy/
MIT License
12.07k stars 1.51k forks source link

Fix decorator-related slow performance #2095

Open bzczb opened 5 months ago

bzczb commented 5 months ago

Inside decorators preprocess_args() and use_clip_fps_by_default(), capture the inspected argnames at decoration time instead of recomputing them every time the wrapped function is called. This improves performance by a great deal, particularly when rendering audio.

Fixes #2094 Certain decorators perform extremely slow function inspection every call

coveralls commented 4 months ago

Coverage Status

coverage: 81.926% (+0.02%) from 81.904% when pulling b9b5ecc61ccb1ba9df3a2ccaf0987fba34d4f84a on bzczb:i2094-slow-decorators into bc8d1a831d2d1f61abfdf1779e8df95d523947a5 on Zulko:master.