Optimize compare() with bsxfun.