3 ms·
That would be neat, but it's not a pure win. It's more just a different set of trade-offs, because it defeats the CPU's return address stack predictor. For exc
by Rusky 6y ago
That would be neat, but it's not a pure win. It's more just a different set of trade-offs, because it defeats the CPU's return address stack predictor.
For exception-like Result enums where you want to predict the Ok variant every time that's probably fine (as long as your CPU is new enough that taking the error path won't cause it to mispredict every return afterwards), but it may or may not be a win in the general case of enum returns.