| > it has to make assumptions about what's going to happen before it knows it, and those assumptions are going to be wrong. How wrong Speculative/optimistic techniques are not limited to branch prediction, you encounter various forms of it pretty much everywhere, without knowing it. * Your hard drives have a read ahead buffer, fetching in advance future data, just because most reads are immediately followed by an other one for the data just after. * Your CPU instructions are pre fetched, because most instructions are _not_ jumps, so you will 99% of the time just execute the instruction right after it. * Instruction reordering where your compiler will decide that future instructions not affected by previous instructions could be run in advance. * Overall any kind of caching is some form of optimistic technique. You are preparing future results. If you think about it, optimistic/speculative techniques are ubiquitous, and used even at _high_ abstraction levels. The famous python mantra of "better ask for forgiveness than permission" embodies that spirit. It encourages a coding style of "try: do() except: nope()" rather than "if check: do()". Standing "against optimistic/speculative techniques" is standing against transactions, rollbacks, caches. It's just not a viable line of thinking IMHO. |