摘要 |
A method for selecting a performance optimization level for program code segments (e.g., JavaScript code) embedded in interactive webpages according to the origin (e.g., domain) of the webpages is disclosed. The information on historic usage behavior on webpages from the same origin is collected. The historic usage behavior can be specific to the current user or an average or aggregated behavior across many users who have visited webpages from the same origin. The historic usage information is used to select an appropriate level of optimization to achieve the maximum performance improvement for the least amount of compilation cost. The selected optimization level can be adjusted over time based on a measure of actual performance improvement resulted from the different levels of optimization that had been carried out during prior visits. |