Performance and memory optimizations.