Optimize resolve performance by performing cheap checks before expensive ones.