compute in chunks avoid large memory writes reuse data efficiently