On Optimal Control of Computational Streams