# US 7,610,580 B2 · System and method for iterative code optimization using adaptive size metrics

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

- Number: US 7,610,580 B2
- Document ID: US7610580B2
- Status: Granted
- Kind: B2
- Application number: 11/177,549
- Filed: 2005-07-08
- Published: 2005-11-03
- Granted: 2009-10-27
- Earliest claimed: 2002-12-17
- Assignees: BEA Systems, Inc.
- Inventors: Marcus Lagergren
- Web page: https://patentgrep.com/patent/US7610580B2

## CPC

- G06F 9/45525: {Optimisation or modification within the same instruction set architecture, e.g. HP Dynamo}
- G06F 8/4434: {Reducing the memory space required by the program code}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A system and method for iterative code optimization using adaptive or dynamic size metrics, for use with run-time software systems and virtual machines. The dynamic size metric may be calculated both for a set of predetermined factors (together with associated weights), and also for a set of variable factors determined during the runtime code introspection process. The predetermined factors, and their associated weights, may be varied to reflect the overall performance of the code in each optimization instance.

## Claims

### Claim 1

A system for performing adaptive optimization of application code in a virtual machine environment, the system comprising:
an application code stored in a memory of the system;
a server including a processor, a virtual machine, and a run-time compiler for compiling the application code;
optimization parameters determined from information from the run-time compiler, wherein each optimization parameter is associated with a weight that reflects a relative effect the optimization parameter has on the system performance as compared to other optimization parameters; and
an optimizer, which calculates a dynamic size metric for the application code based on the geometric mean of the weighted optimization parameters multiplied by a growth factor, and uses the dynamic size metric to optimize the application code during run-time.

### Claim 2 (depends on 1)

The system of claim 1, wherein the system uses the run-time compiler to compile application code for use by the virtual machine itself.

### Claim 3 (depends on 1)

The system of claim 1, wherein the system includes a plurality of application code.

### Claim 4 (depends on 1)

The system of claim 1, wherein the virtual machine is a Java Virtual Machine.

### Claim 5 (depends on 1)

The system of claim 1, wherein some of the optimization parameters are specified by a software developer prior to run-time.

### Claim 6 (depends on 1)

The system of claim 1,
wherein the size metric is evaluated by the formula;
S
⁡
(
code
)
=
(
∏
1
⁢
⁢
…
⁢
⁢
n
⁢
C
n
⁢
V
n
n
)
x
and wherein v represents variables used in evaluating the size matrix, n represents the number of variables, c represents weights associated with each variable, and x represents a growth factor exponent.

### Claim 7

A computer-implemented method for performing optimization of an application code in a virtual machine environment, the method comprising:
determining optimization parameters from a run-time compiler about an application code being compiled by the run-time compiler;
weighting each of the determined optimization parameters, wherein each weight reflects a relative effect the determined optimization parameter has on the virtual machine environment performance as compared to other determined optimization parameters;
calculating a dynamic size metric for the application code based on the geometric mean of the weighted optimization parameters multiplied by a growth factor; and
optimizing the application code during run-time based on the dynamic size metric.

### Claim 8 (depends on 7)

The computer-implemented method of claim 7, wherein determining optimization parameters comprises compiling by the run-time compiler of the application code for use by a virtual machine in the virtual machine environment.

### Claim 9 (depends on 7)

The computer-implemented method of claim 7, wherein determining optimization parameters comprises performing the determining for a plurality of application code.

### Claim 10 (depends on 7)

The computer-implemented method of claim 7, wherein the virtual machine environment is a Java Virtual Machine environment.

### Claim 11 (depends on 7)

The computer-implemented method of claim 7, wherein determining optimization parameters comprises specifying some of the optimization parameters by a software developer prior to run-time.

### Claim 12 (depends on 7)

The computer-implemented method of claim 7,
wherein the size metric is evaluated by the formula:
S
⁡
(
code
)
=
(
∏
1
⁢
⁢
…
⁢
⁢
n
⁢
C
n
⁢
V
n
n
)
x
and wherein v represents variables used in evaluating the size matrix, n represents the number of variables, c represents weights associated with each variable, and x represents a growth factor exponent.

### Claim 13

A computer readable storage medium including instructions stored thereon which when executed cause the computer to perform the steps of:
determining optimization parameters from a run-time compiler about an application code being compiled by the run-time compiler;
weighting each of the determined optimization parameters, wherein each weight reflects a relative effect the determined optimization parameter has on the virtual machine environment performance as compared to other determined optimization parameters;
calculating a dynamic size metric for the application code based on the geometric mean of the weighted optimization parameters multiplied by a growth factor; and
optimizing the application code during run-time based on the dynamic size metric.

### Claim 14 (depends on 1)

The system of claim 1, wherein the dynamic size metric is adjusted to account for architecture specific requirements that vary from one system to another.

### Claim 15 (depends on 1)

The system of claim 1, wherein the dynamic size metric is evaluated by taking the geometric mean of the weighted optimization parameters, for a number n optimization parameters v associated with a number n of weights c, wherein a growth factor exponent x is applied to the geometric mean.

### Claim 16 (depends on 7)

The computer-implemented method of claim 7, further comprising adjusting the dynamic size metric to account for architecture specific requirements that vary from one system to another.

### Claim 17 (depends on 7)

The computer-implemented method of claim 7, wherein the dynamic size metric is evaluated by taking the geometric mean of the weighted optimization parameters, for a number n optimization parameters v associated with a number n of weights c, wherein a growth factor exponent x is applied to the geometric mean.
