We present improvements to the backtracking technique of pattern-matching c
ompilation. Several optimizations are introduced, such as commutation of pa
tterns, use of exhaustiveness information, and control flow optimization th
rough the use of labeled static exceptions and context information. These o
ptimizations have been integrated in the Objective-Caml compiler. They have
shown good results in increasing the speed of pattern-matching intensive p
rograms, without increasing final code size.