branch prediction does: guesses which way an if-statement will go to keep the pipeline full

How can a computer make decisions faster?

Image: MODIS Land Rapid Response Team, NASA GSFC, Public domain, via Wikimedia Commons

branch prediction does: guesses which way an if-statement will go to keep the pipeline full

How can a computer make decisions faster?

Imagine you're reading a mystery book and you have to decide whether to jump to the next chapter based on clues. Without guessing, you'd wait until the end of the chapter to see if the clues make sense, slowing down your reading.

A computer uses a branch predictor to guess whether to jump to the next chapter or continue reading, making the reading process faster by avoiding unnecessary stops.

Example

If the computer guesses correctly, it skips unnecessary chapters, just like guessing the next chapter in a mystery book.

Remember this

The branch predictor guesses the direction of a "branch" (like a decision point) to keep the computer's instruction pipeline moving smoothly.

Related concepts

Swipe through 100 ML concepts daily

Open Pocket Polymath