A system optimizes two or more stream processing programs based upon the
data exchanged between the stream processing programs. The system
alternately processes each stream processing program to identify and
remove dead program code, thereby improving execution performance. Dead
program code is identified by propagating constants received as inputs
from other stream processing programs and by analyzing a first stream
processing program and determining the outputs of a second stream
processing program that are unused by the first stream processing
program. The system may perform multiple iterations of this optimization
is previous iterations introduce additional constants used as inputs to a
stream processing program. Following optimization of the stream
processing programs, the optimized stream processing programs are
compiled to a format adapted to be executed by a stream processing
system.