1. A computer-implemented method for optimizing a task graph that delineates a plurality of tasks to be evaluated in a parallel processing environment, the method comprising: generating a first aggregation topology associated with the task graph that divides the plurality of tasks into a first collection of sets, wherein each set in the first collection of sets includes one or more tasks from the plurality of tasks, and each task of the plurality of tasks belongs to only one set included in the first collection of sets; compiling the plurality of tasks according to the first task aggregation topology to generate units of work to be executed in the parallel processing environment; collecting statistics associated with executing the units of work in the parallel processing environment; and determining whether the first task aggregation topology is more efficient in execution than any previously-defined task aggregation topology based on the statistics; and if the task aggregation topology is more efficient in execution than any previously-defined task aggregation topology, then selecting the first task aggregation topology as the most optimal task aggregation topology, or if the first task aggregation topology is not more efficient in execution than any previously-defined task aggregation topology, then selecting a second task aggregation topology as the most optimal task aggregation topology.