Techniques for partitioning modules into smaller groups are disclosed. In
various embodiments, cross-module optimization may be performed on these
smaller groups. Further, related modules are grouped together based on a
predefined algorithm. Relatedness, or closeness, or affinity, of modules
are considered based on various factors including, for example, the
number of calls between routines in different modules, possibility of
in-lining a first routine in a first module into a second routine in a
second module, characteristics of parameters being passed between
routines in different modules, etc.