Minor allocation tweaks

A handful of small changes to reduce allocations in the main loop.

These were found via profiling, so whilst only small tweaks they should net a nice 2-3% saving of memory allocations each tick. Plus a little CPU too I should tick.
This could do with a comment explaining that this is cached as an optimization.  A well meaning contributor might otherwise remove this in the future, in the name of code simplification.