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.
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.