How to write low latency PD-Patches
Strategies for doing low latency patches
Block size causes latency:
- block size and objects wich collects many blocks causes a delay at latency at least at block size.
Beware of "system objects":
There are two kinds of objects:
- objects no system calls.
- objects with system calls
System calls causes the OS-Scheduler to switch to other processes which can block (busy waiting or sleeping) PD. Here especially calls on filessystem tends to cause a big latency, except if they are threaded like with writesf~ or readsf~.
Distribute large calclation over ticks:
- Beware of big Message calculation at a common trigger time. This often happens if you youse a metro to get a kind of controlrate for messages doing mixing, envelopes etc.
- dont use objects which does big calculation at one time tick like correlation or so.
Here a list of good to bad objects has to done. But since objects always changes from Version to Version its better just to test the objects for its behaviour at doing the patch, since some sideeffects also makes it unpredictable.