Reduce contention and unnecessary checks at each lookup, part of xambug #14644.