[perf] minor performance optimizations