Optimized use of local memory buffers