1. A method of compiling a computer program to optimize performance of said compiled computer program, said method comprising the steps of: a) initializing a profiling run of computer code to be optimized; b) monitoring execution of each step of said computer program and logging each occurrence of each individual code unit; c) identifying a plurality of code units as hot blocks; d) logging a snapshot of hot blocks when identified hot blocks exceeds an initial number selected; e) updating identified hot blocks; f) logging a new current snapshot whenever a current set of identified hot blocks contains a selected percentage of hot blocks different than hot blocks contained in a most recent snapshot; g) repeating steps e)-f) until execution of said program being profiled is complete; and h) selecting a plurality of snapshots corresponding to program modes, said program being optimized according to said program modes.