By the power of templates!

Use smaller int types, where possible. This gains a few percent.