1. A method for optimizing virtual machine or interpreted code comprising: receiving code comprising a plurality of program instructions and first extraneous information, wherein the code is written in a language for execution by a virtual machine and wherein the first extraneous information is a first type of non-executable information; modifying the code by removing the first extraneous information and replacing it with a key that references a location of the first extraneous information; and executing the modified code and, if an event requesting the first extraneous information occurs during execution, using the key to locate the first extraneous information in the location in response to the event, and loading the first extraneous information from the location.