Perf optimizations