Optimization of Memoization

Add fastMatchMode.