Small optimizations based on profiling