MatcherException is from the generic kil class hierarchy. It is relatively expensive to construct because it needs to fill in the stacktrace. Since the Java engine only uses this exception for control-flow, I wrote the UnificationFailure/PatternMatchingFailure which implements the singleton pattern and has no stacktrace inside.