At the time of writing, if $c { $i } else { $e } builds MIR that is simpler and therefore is ~1-3% better in terms of compile times than match $c { $i } else { $e }. However, after the early-opt MIR optimization, they are basically the same.
In #59288 we start desugaring if expressions to match and so if we optimize for the special case of two match arms we can potentially improve compiles times.
cc @oli-obk
At the time of writing,
if $c { $i } else { $e }builds MIR that is simpler and therefore is ~1-3% better in terms of compile times thanmatch $c { $i } else { $e }. However, after theearly-optMIR optimization, they are basically the same.In #59288 we start desugaring
ifexpressions tomatchand so if we optimize for the special case of two match arms we can potentially improve compiles times.cc @oli-obk