Constraint Handling Rules were recently extended with user-definable rule priorities. This paper shows how this extended language
can be efficiently compiled into the underlying host language. It extends previous work by supporting rules with dynamic priorities
and by introducing various optimizations. The effects of the optimizations are empirically evaluated and the new compiler
is compared with the state-of-the-art K.U.Leuven CHR system.