stream: optimize pipeline for protocols