1. A method for processing a graph-based program specification, the method including: receiving the graph-based program specification, the graph-based program specification including: a plurality of components, each corresponding to a processing task and including one or more ports, the ports including scalar data ports for sending or receiving a single data element and collection data ports for sending or receiving a collection of multiple data elements; and one or more links, each link of the one or more links connecting an output port of an upstream component of the plurality of components to an input port of a downstream component of the plurality of components; and processing the graph-based program specification to generate prepared code representing subsets of the plurality of components of the graph-based program specification, the processing including: identifying one or more subset boundaries, including identifying one or more links connecting a collection data port of a component to a scalar data port of a component; forming the subsets based on the identified subset boundaries; and generating prepared code for each formed subset that when used for execution by a runtime system causes processing tasks corresponding to the components in each formed subset to be performed.