1. A method for optimizing performance in a complex event stream (CEP) system, the method comprising: obtaining, using one or more hardware processors, information about a plurality of CEP threads; determining, using the one or more hardware processors, nearness among the plurality of CEP threads, wherein determining nearness between a first and a second CEP thread indicates how much interaction is expected to occur between the first and second CEP thread and includes creating a Directed Acyclic Graph (DAG), with each of the plurality of CEP threads assigned a different node in the DAG and edges between nodes representing data dependencies among the threads, and wherein each edge in the DAG is assigned a nearness value, the nearness value between the first and second threads being measured by calculating an actual amount of data transmitted between the first and second threads during a set period; organizing the plurality of CEP threads into a plurality of CEP thread groups, based on the determined nearness; and assigning, using the one or more hardware processors, each of the plurality of CEP thread groups to a different processing node of a plurality of processing nodes, each processing node having one or more processors and a memory.