1. A method of event sampling for an application, comprising: attaching a runtime optimizer to the application at runtime; running the application; recording a plurality of events during runtime, the recording of the plurality of events includes capturing an event type for each of the plurality of events; recording a plurality of actions, the recording of the plurality of actions includes capturing a time mark at which each of the plurality of actions occurred; and creating an optimizer file including the recorded events, actions and time marks for the actions, the optimizer file being stored on a non-volatile storage medium.