일괄 임시 List와 element pipeline은 저장 위치가 다르다

filter 결과 전체를 먼저 저장하면 peak memory가 커지고 다음 단계 시작도 늦어집니다.

batch lists

filter List + map List · O(N) 중간 저장

element pipeline

현재 원소 중심 · 작은 working set

stateful op

sorted·distinct는 상태 보유

핵심: stream은 현재 element를 operation chain으로 내려 보내지만 stateful operation은 별도 buffer가 필요합니다.