# US 8,789,033 B2 · Reducing application startup time by optimizing spatial locality of instructions in executables

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

- Number: US 8,789,033 B2
- Document ID: US8789033B2
- Status: Granted
- Kind: B2
- Application number: 13/365,317
- Filed: 2012-02-03
- Published: 2013-08-08
- Granted: 2014-07-22
- Earliest claimed: 2012-02-03
- Assignees: International Business Machines Corporation
- Applicants: Vishal Chittranjan Aslot; Aravinda Prasad
- Inventors: Vishal Chittranjan Aslot; Aravinda Prasad
- Web page: https://patentgrep.com/patent/US8789033B2

## CPC

- G06F 8/4441: {Reducing the execution time required by the program code}
- G06F 8/427: {Parsing}
- G06F 8/443: {Optimisation}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Provided are techniques for parsing source code file into a plurality of functions; generating a ranking corresponding to each of the plurality of functions based upon an order of occurrence in the source code file; generating a weight score corresponding to each of the plurality of functions based upon a weighing factor and the occurrence of a condition corresponding to each of the plurality of functions; and generating an object code file such that the plurality of functions are ordered in the object code file based upon the corresponding rankings and weight scores such during a startup of execution of the object code file a startup time is minimized with respect to an object code file not generated in accordance with the claimed method.

## Claims

### Claim 1

A method, comprising;
parsing, on a plurality of processors, a source code file into a plurality of functions;
ranking, on the plurality of processors, each particular function of the plurality of functions based upon an order of occurrence of each particular function in the source code file;
generating, on the plurality of processors, a weight score for each function of the plurality of functions, wherein the weight score of each particular function corresponds to whether or not the particular function is called conditionally; and
generating, on the plurality of processors, an object code file such that the plurality of functions are ordered in the object code file based upon the corresponding rankings and weight scores.

### Claim 2 (depends on 1)

The method of claim 1, wherein the plurality of functions are ordered in the object code file such that a startup time is minimized.

### Claim 3 (depends on 1)

The method of claim 1, generating a weight score comprising adjusting a corresponding weight score for the particular function based upon a number of times the particular function is called conditionally.

### Claim 4 (depends on 3)

The method of claim 3, generating the weight score of a first function comprising taking a minimum between a weight score corresponding to the first function and a weight score corresponding to a second function that calls the first function.

### Claim 5 (depends on 4)

The method of claim 4, wherein, when the second function calls the first function conditionally, the weight score of the second function is divided by a reduction factor prior to taking the minimum.

### Claim 6

An apparatus, comprising:
a processor;
a computer-readable storage medium coupled to the processor; and
logic, stored on the computer-readable medium and executed on the processor, for:
parsing a source code file into a plurality of functions;
ranking each particular function of the plurality of functions based upon an order of occurrence of each particular function in the source code file;
generating a weight score for each function of the plurality of functions, wherein the weight score of each particular function corresponds to whether or not the particular function is called conditionally; and
generating an object code file such that the plurality of functions are ordered in the object code file based upon the corresponding rankings and weight scores.

### Claim 7 (depends on 6)

The apparatus of claim 6, wherein the plurality of functions are ordered in the object code file such that a startup time is minimized.

### Claim 8 (depends on 6)

The apparatus of claim 6, the logic for generating a weight score comprising logic for adjusting a corresponding weight score for the particular function based upon a number of times the particular function is called conditionally.

### Claim 9 (depends on 8)

The apparatus of claim 8, the logic for generating the weight score of a first function comprising logic for taking a minimum between a weight score corresponding to the first function and a weight score corresponding to a second function that calls the first function.

### Claim 10 (depends on 9)

The apparatus of claim 9, wherein, when the second function calls the first function conditionally, the weight score of the second function is divided by a reduction factor prior to taking the minimum.

### Claim 11

A method for generating an application, comprising:
parsing, on a plurality of processors, a source code file corresponding to the application into a plurality of functions;
ranking, on the plurality of processors, each particular function of the plurality of functions based upon an order of occurrence of each particular function in the source code file;
generating, on the plurality of processors, a weight score for each function of the plurality of functions, wherein the weight score of each particular function corresponds to whether or not the particular function is called conditionally;
generating, on the plurality of processors, an object code file, corresponding to the application, such that the plurality of functions are ordered in the object code file based upon the corresponding rankings and weight scores; and
storing, on the plurality of processors, the object code file on computer-readable storage medium such that the application can be executed by a processor.

### Claim 12 (depends on 11)

The method of claim 11, wherein the plurality of functions are ordered in the object code file such that a startup time of the application is minimized.

### Claim 13 (depends on 11)

The method of claim 11, generating a weight score comprising adjusting a corresponding weight score for the particular function based upon a number of times the particular function is called conditionally.

### Claim 14 (depends on 13)

The method of claim 13, generating the weight score of a first function comprising taking a minimum between a weight score corresponding to the first function and a weight score corresponding to a second function that calls the first function.

### Claim 15 (depends on 14)

The method of claim 14, wherein, when the second function calls the first function conditionally, the weight score of the second function is divided by a reduction factor prior to taking the minimum.

### Claim 16

A computer programming product, comprising:
a non-transitive computer-readable storage medium; and
logic, stored on the computer-readable storage medium for execution on a plurality of processors, for generating a computer application, comprising logic for:
parsing a source code file into a plurality of functions;
ranking each particular function of the plurality of functions based upon an order of occurrence of each particular function in the source code file;
generating a weight score for each function of the plurality of functions, wherein the weight score of each particular function corresponds to whether or not the particular function is called conditionally; and
generating an object code file, corresponding to the application, such that the plurality of functions are ordered in the object code file based upon the corresponding rankings and weight scores.

### Claim 17 (depends on 16)

The computer programming product of claim 16, wherein the plurality of functions are ordered in the object code file such that a startup time is minimized.

### Claim 18 (depends on 16)

The computer programming product of claim 16, the logic for generating a weight score comprising logic for adjusting a corresponding weight score for the particular function based upon a number of times the particular function is called conditionally.

### Claim 19 (depends on 18)

The computer programming product of claim 18, the logic for generating the weight score of a first function comprising logic for taking a minimum between a weight score corresponding to the first function and a weight score corresponding to a second function that calls the first function.

### Claim 20 (depends on 19)

The computer programming product of claim 19, wherein, when the second function calls the first function conditionally, the weight score of the second function is divided by a reduction factor prior to taking the minimum.

### Claim 21

A compiler for generating a computer application, comprising logic, stored on a non-transitive computer-readable medium for execution on a processor, for:
parsing a source code file into a plurality of functions;
ranking each particular function of the plurality of functions based upon an order of occurrence of each particular function in the source code file;
generating a weight score for each function of the plurality of functions, wherein the weight score of each particular function corresponds to whether or not the particular function is called conditionally; and
generating an object code file such that the plurality of functions are ordered in the object code file based upon the corresponding rankings and weight scores.

### Claim 22 (depends on 21)

The compiler of claim 21, wherein the plurality of functions are ordered in the object code file such that a startup time is minimized.

### Claim 23 (depends on 21)

The compiler of claim 21, the logic for generating a weight score comprising logic for adjusting a corresponding weight score for the particular function based upon a number of times the particular function is called conditionally.

### Claim 24 (depends on 23)

The compiler of claim 23, the logic for generating the weight score of a first function comprising logic for taking a minimum between a weight score corresponding to the first function and a weight score corresponding to a second function that calls the first function.

### Claim 25 (depends on 24)

The apparatus of claim 24, wherein, when the second function calls the first function conditionally, the weight score of the second function is divided by a reduction factor prior to taking the minimum.
