match
and if
get compiled as the same sets of instructions, none is particularly faster than the other. match
is essentially a different way to express things in a more concise way. It certainly makes you write the variable only once, but it still has to compare its value for each case (i.e it's not a jump table like in C).