This is used everywhere (compiler optimizations, QA predictions, speculatively parallelizing code).
Speculative Evaluation
We could parallelize code that needs to run no matter what, and code that runs in a conditional (as they as there is no dependancy), this is a pre-computation to speed things up.
Value Speculation
This is speculative execution where there is dependancy, but here, we predict the dependant value.
- We can estimate the impact of value speculation by parameterizing:
- Time it takes to run something
- Probability that something needs to run again
- Synchronization overhead