tiny optimizations to renderer.rs