# US 8,543,907 B1 · Context-sensitive optimization level selection

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 8,543,907 B1
- Document ID: US8543907B1
- Status: Granted
- Kind: B1
- Application number: 12/581,021
- Filed: 2009-10-16
- Granted: 2013-09-24
- Earliest claimed: 2009-10-16
- Assignees: Google Inc.
- Applicants: James A. Roskind
- Inventors: James A. Roskind
- Web page: https://patentgrep.com/patent/US8543907B1

## CPC

- G06F 8/443: {Optimisation}
- G06F 16/958: Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

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.

## Claims

### Claim 1

A computer-implemented method, comprising:
receiving, from a server, one or more segments of program code embedded in a webpage having an origin;
receiving information on a user's prior code invocation behavior of code on webpages from the origin;
selecting a level of performance optimization for the one or more segments of the program code in advance of compilation of the segments of the program code based on, at least, the received information, and wherein the level of performance optimization specifies a type of program code compilation optimization for the one or more segments; and
performing, by a processor, the selected level of performance optimization on the one or more segments of the program code.

### Claim 2 (depends on 1)

The method of claim 1, wherein the origin of the webpage includes one of a domain name of a web server hosting the webpage, a file path of the webpage on the web server hosting the webpage, an identifier of a template used for creating the webpage, and an identifier of a creator of the webpage.

### Claim 3 (depends on 1)

The method of claim 1 wherein selecting the level of performance optimization further comprises:
receiving second information on aggregated usage behavior on webpages from the origin of the webpage, the aggregated usage behavior being derived from prior usage behaviors of multiple users on the webpages from the origin; and
selecting the level of performance optimization based on the second information.

### Claim 4 (depends on 1)

The method in claim 1 wherein selecting the level of performance optimization further comprises:
receiving a recommendation, the recommendation specifying a recommended level of performance optimization for the webpage; and
selecting the level of performance optimization based on the recommended level of performance optimization.

### Claim 5 (depends on 1)

The method in claim 1, further comprising:
recording a measure of performance improvement due to the selected level of performance optimization being performed during the user's prior visit to another webpage from the origin of the webpage; and
adjusting, based on the measure of performance improvement, the selected level of performance optimization for the webpage.

### Claim 6 (depends on 1)

The method in claim 1, wherein the webpage is a search result supplied by a search engine, and the level of performance optimization is selected based on a recommendation by the search engine.

### Claim 7

A computer storage medium encoded with a computer program, the program comprising instructions that when executed by data processing apparatus cause the data processing apparatus to perform operations comprising:
receiving, from a server, one or more segments of program code embedded in a webpage having an origin;
receiving information on a user's prior code invocation behavior of code on webpages from the origin;
selecting a level of performance optimization for the one or more segments of the program code in advance of compilation of the segments of the program code based on, at least, the received information, and wherein the level of performance optimization specifies a type of program code compilation optimization for the one or more segments; and
performing the selected level of performance optimization on the one or more segments of the program code.

### Claim 8 (depends on 7)

The computer storage medium of claim 7, wherein selecting the level of performance optimization further comprises:
receiving second information on aggregated usage behavior on webpages from the origin of the webpage, the aggregated usage behavior being derived from prior usage behaviors of multiple users on the webpages from the origin; and
selecting the level of performance optimization based on the second information.

### Claim 9 (depends on 7)

The computer storage medium of claim 7, wherein selecting the level of performance optimization further comprises:
receiving a recommendation, the recommendation specifying a recommended level of performance optimization for the webpage; and
selecting the level of performance optimization based on the recommended level of performance optimization.

### Claim 10 (depends on 7)

The computer storage medium of claim 7, wherein the operations further comprise:
recording a measure of performance improvement due to the selected level of performance optimization being performed during the user's prior visit to another webpage from the origin of the webpage; and
adjusting, based on the measure of performance improvement, the selected level of performance optimization for the webpage.

### Claim 11 (depends on 7)

The computer storage medium of claim 7, wherein the webpage is a search result supplied by a search engine, and the level of performance optimization is selected based on a recommendation by the search engine.

### Claim 12

A system comprising:
one or more processors;
memory coupled to the one or more processors and operable for storing instructions, which, when executed by the one or more processors, cause the one or more processors to perform operations, comprising:
receiving, from a server, one or more segments of program code embedded in a webpage having an origin;
receiving information on a user's prior code invocation behavior of code on webpages from the origin;
selecting a level of performance optimization for the one or more segments of the program code in advance of compilation of the segments of the program code based on, at least, the received information, and wherein the level of performance optimization specifies a type of program code compilation optimization for the one or more segments; and
performing the selected level of performance optimization on the one or more segments of the program code.

### Claim 13 (depends on 12)

The system of claim 12, wherein selecting the level of performance optimization further comprises:
receiving second information on aggregated usage behavior on webpages from the origin of the webpage, the aggregated usage behavior being derived from prior usage behaviors of multiple users on the webpages from the origin; and
selecting the level of performance optimization based on the second information.

### Claim 14 (depends on 12)

The system of claim 12, wherein the operations further comprise:
receiving a recommendation, the recommendation specifying a recommended level of performance optimization for the webpage; and
selecting the level of performance optimization based on the recommended level of performance optimization.

### Claim 15 (depends on 12)

The system of claim 12, wherein the operations further comprise:
recording a measure of performance improvement due to the selected level of performance optimization being performed during the user's prior visit to another webpage from the origin of the webpage; and
adjusting, based on the measure of performance improvement, the selected level of performance optimization for the webpage.

### Claim 16 (depends on 12)

The system of claim 12, wherein the webpage is a search result supplied by a search engine, and the level of performance optimization is selected based on a recommendation by the search engine.
