Some performance work

Merged Paal Kvamme requested to merge kvamme62/performance-work into master

Some performance work. See individual commit comments for details.

Merge request reports