1. A method for compiling a data stream processing application, wherein the method comprises: receiving, by a compiler executing on a computer system, source code for a data stream processing application, wherein the source code comprises source code for a plurality of operators, each of which performs a data processing function; determining, by the compiler, one or more characteristics of the plurality of operators within the data stream processing application, wherein said determining comprises: injecting profiling code into an instrumented version of the data stream processing application; running the data stream processing application under a sample workload; using the profiling code to collect one or more computation and communication characteristics of the plurality of operators within the data stream processing application; and processing the one or more collected computation and communication characteristics to compute (i), for each of the plurality of operators, an average amount of demanded processing resources and, (ii) for each port of the plurality of operators, a mean data rate; grouping, by the compiler, the plurality of operators into one or more execution containers based on the average amount of demanded processing resources and the mean data rate computations; and compiling, by the compiler, the source code for the data stream processing application into executable code, wherein the executable code comprises a plurality of execution units, wherein each execution unit contains one or more of the plurality of operators, wherein each operator is assigned to an execution unit based on the grouping, and wherein each execution unit is to be executed in a partition.