Optimize cached batch comparer