1. A method for automatically rewriting a web application to improve perceived application performance, comprising steps for: receiving a web application that is designed to be executed within a browser-type application on a client computing device (i.e., the client); decomposing structural code units of the web application into a set of stubs and a set of corresponding bodies; determining a clustering of structural code units within the web application, said clustering being based, in part, on an identification of first execution times for each structural code unit, each first execution time representing a particular point in time corresponding to a first-access time that is observed at runtime for each particular structural code unit; constructing a new application by rewriting the web application based on the clustering, wherein stubs are used to replace corresponding structural code units in the application to reduce a total size of code that that must be transferred to the client; wherein each stub retrieves the corresponding body to the client when the stub is executed within the browser-type application on the client; and wherein the retrieved corresponding body is then used to enable client-side execution of the corresponding body.