On 31/05/2017 13:51, Andrzej Krzemienski via Boost wrote:
2017-05-31 14:35 GMT+02:00 Niall Douglas via Boost
: On 30/05/2017 23:34, Gottlob Frege via Boost wrote:
Would you not rather manually "predict" for the valued state?
Predictable latency for success or failure is a key design goal for Outcome. If you want success to be preferred, choose Expected instead.
If success is 0 extra cycles, and failure is 20 extra cycles, it is still predictable, just not equal. ?
No, because for every branch taken on an outcome, you multiply your potential runtime execution paths by two. If success and failure are not balanced, it totally ruins predictability.
Niall, could you point me to some materials that would explain and justify why people need this guarantee?
The kind of people who study http://www.agner.org/optimize/microarchitecture.pdf in detail. In my opinion at least it's irrelevant on any Intel CPU since Haswell whose ability to recognise branch patterns is spooky, and manual tuning really makes no difference any more. It still matters a lot for some ARM CPUs though. But I wouldn't worry about any of this too much, it's such a micro optimisation. Niall -- ned Productions Limited Consulting http://www.nedproductions.biz/ http://ie.linkedin.com/in/nialldouglas/