A method and system for collaborative profiling for continuous detection of profile
phase transitions is disclosed. In one embodiment, the method, comprises using
hardware and software to perform continuous edge profiling on a program; detecting
profile phase transitions continuously; and optimizing the program based upon the
profile phase transitions and edge profile.