Ring buffers and moving averages
casualjavascript.com
casualjavascript.com
It's a handy trick in financial software, where you often need to calculate relatively small sliding windows over enormously large data streams and latency is critical. The same technique generalizes to any computation that can be expressed as a fold function where the operation is invertible.