Improved sliding window efficiency