olofson / audiality2

A realtime scripted modular audio engine for video games and musical applications.
http://audiality.org/
zlib License
80 stars 5 forks source link

Speculative mix-ahead #356

Open olofson opened 1 year ago

olofson commented 1 year ago

Not sure if this is viable or necessary in this day and age, but the idea might be useful in some odd scenarios...

Anyway, the basic idea is to steal the pipeline branch prediction concept from CPUs. In our case, we essentially assume that no further events will arrive for the foreseeable time, so we continuously take snapshots of the current subgraph state, and then allow processing to run ahead from there, buffered, potentially in a background thread.

If a new event does arrive, we can reset the state of the subgraph, and resume processing from there, discarding any buffered output.