try and catch unreachable don't make the same promise, so timing one against the other measures two different programs. Both versions call a function that returns an error union. One uses try to pass a failure to its caller. The other, the one expected to win, uses catch unreachable.
That second spelling asserts failure cannot happen. If it does happen, safety-checked builds can crash. The obligation to return the error is gone, so its timing doesn't price equivalent behavior.
Plan, in rough order.
- Compare
trypropagation against an explicit branch that returns the same error. - Same inputs, payload work, allocation ownership and caller handling on both sides.
- Success-only runs and deliberately injected failures, measured apart. Then a mixed workload with a recorded error frequency.
- Setup outside the timed region unless the stated workload includes it.
- Record compiler version, build mode, target, machine conditions, and enough repeated trials to show variation.
catch unreachable can join a success-only run if a stated precondition rules out every relevant error for those inputs. The conclusion then stays inside that precondition. Reading the generated code might explain a result later. It won't stand in for one.
That is the comparison I would run. No result yet.