Cache and memory optimizations