only canonicalize if needed

empty build about 3% faster

$ measure.py 200 ninja
sampling: ...
best: 147ms
mean: 156ms +- 6.2ms

$ measure.py 200 ninja
sampling: ...
best: 152ms
mean: 161ms +- 6.1ms