Speculative execution performs work before it is certain that the work will be needed. A CPU may execute a predicted path or load data early to hide latency. If the result is needed, it is already available; otherwise, the speculative result is discarded. section 11.4
The same idea applies beyond processors. First identify an operation whose latency is hard to reduce, then predict when its result will be needed and start it early. Prediction is the difficult part: an accurate guess hides latency, while a wrong one spends resources without delivering a useful result. section 11.1 section 11.4
Load data while a user authenticates
A web application can prefetch user-specific data in parallel with authentication. If that data is needed when login finishes, its access latency has been hidden; if not, the fetch was wasted work. Prefetching is a particular way to speculate about future data needs. section 11.1 section 11.4
The cost of a wrong prediction depends on where speculation runs. A CPU may use spare cycles and parallel execution units with little throughput penalty. Application-level speculation can consume CPU, memory, and network capacity; failed predictions may even increase latency. CPU behavior can also contribute to latency variance that software cannot directly control. section 11.4 section 2.3.2

