Improve lookupOrd performance.