Performance guidelines
Video effects, audio effects and generators can execute many times per second. Treat processor functions as hot paths and move expensive analysis out of the real-time render loop whenever possible.
Hot-path guidelines
- Reuse immutable lookup tables, kernels and plans instead of rebuilding them per frame.
- Cache expensive data by parameter signature when reuse is safe.
- Prefer vectorized NumPy operations over Python per-pixel or per-sample loops.
- Avoid filesystem scans, network requests and model loading inside frame/audio processors.
- Return early for provably neutral parameter states.
- Avoid unnecessary copies of full-resolution frames or long audio arrays.
- Keep generator output exactly at the requested size.
Use host metadata correctly
- Set
time_dependentaccurately. - Add
time_dependent_whenwhen only some parameter states are animated. - Add
bypass_whenfor states that are exactly neutral. - Use a timeline processor for expensive analysis that does not belong in the real-time path.
Tip: For model-based tools, load the model once per processor run or cache it at module scope when the underlying library is safe to reuse.