Various performance improvements to drawing and loading.