27 May
2017
27 May
'17
10:14 p.m.
What does it mean tha "outcome is equally costly on T or E branches chosen"?
Have a look at https://godbolt.org/g/bVd4D7, specifically the disassembly.
As you'll note, the first possible state (empty) tends to be chosen by the compiler as the most likely. That implies a 20 cycle branch misprediction cost for each of the valued or errored states. So they are equally costly, which is intentional.
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. Niall -- ned Productions Limited Consulting http://www.nedproductions.biz/ http://ie.linkedin.com/in/nialldouglas/