1. In a system for operating computer programs, said programs comprising machine code having a plurality of procedures, a method for optimizing placement of procedures within a target program, the method comprising: (a) dividing execution of said target program into a plurality of activities which are based on operation of said target program by an end user, each of said activities requiring invocation of at least one procedure of said target program for completion of said each activity; (b) for each of said activities, executing said target program and at completion of said each activity, storing profile information for indicating which procedures of said target program were invoked for completion of said each activity; and (c) placing procedures which are invoked for a particular set of activities in contiguous locations of said target program, based on said profile information stored for each activity.