The not function from the standard library is implemented especially by the compiler backend so that more performant assembly is generated. The match_not function on the other hand is compiled according to the general compilation strategy that applies to any pattern matching (using branches), which results in slightly less efficient assembly.