IP Library Granted Patent US 8,387,036
Granted Patent B2
US 8,387,036 · App. 12/694,883 · Granted Feb 26, 2013

Method and system for execution profiling using loop count variance

Inventor: John Rose (San Jose, CA)
Assignee: Oracle America, Inc.
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 8,387,036
App. No.
12/694,883
Granted
Feb 26, 2013
Kind
B2
Abstract

A method for executing a computer program involving obtaining a statement of the source code, where the statement comprises a method call, and where the source code is composed in a statically-typed programming language. The method also involves, upon entry into a loop included in the computer program: incrementing an entry counter by one; and, for each iteration of the loop, incrementing an iteration counter by one, incrementing a local counter by one to obtain an incremented value of the local counter, incrementing a summation variable by the incremented value of the local counter, and executing the iteration of the loop.

Claims (47)

1. A non-transitory computer readable storage medium having computer readable program code embodied therein, the computer readable program code adapted to, when executed by a processor, implement a method for executing a computer program, the method comprising:

upon entry into a loop included in the computer program:

incrementing an entry counter by one;

for each iteration of a plurality of iterations of the loop:

incrementing an iteration counter by one;

incrementing a local counter by one to obtain an incremented value of the local counter;

increasing a value of a summation variable by the incremented value of the local counter; and

executing the iteration of the loop; and

calculating a variance for the number of iterations per entry into the loop using the entry counter, the value of the summation variable, and the iteration counter to obtain an execution profile for the loop.

2. The non-transitory computer readable storage medium of claim 1 , further comprising, upon entry into the loop, setting the local counter to zero.

3. The non-transitory computer readable storage medium of claim 1 , wherein the entry counter, the iteration counter, and the summation variable are stored in the execution profile associated with the loop.

4. The non-transitory computer readable storage medium of claim 1 , wherein the loop is one of a plurality of loops included in the computer program.

5. The non-transitory computer readable storage medium of claim 4 , wherein each of the plurality of loops is associated with a different execution profile.

6. The non-transitory computer readable storage medium of claim 1 , further comprising using the entry counter and the iteration counter to calculate an average number of iterations per entry into the loop.

7. The non-transitory computer readable storage medium of claim 1 , further comprising determining whether the variance is above a predefined threshold.

8. The non-transitory computer readable storage medium of claim 7 , further comprising, upon determining that the variance is above a predefined threshold, compiling the loop into a generalized version of the loop.

9. The non-transitory computer readable storage medium of claim 7 , further comprising, upon determining that the variance is not above a predefined threshold, compiling the loop into a specialized version of the loop.

10. A non-transitory computer readable storage medium having computer readable program code embodied therein, the computer readable program code adapted to, when executed by a processor, implement a method for executing a computer program, the method comprising:

upon entry into a loop included in the computer program:

incrementing an entry counter by one;

setting a local counter to zero;

for each iteration of the loop:

incrementing an iteration counter by one;

incrementing the local counter by one to obtain an incremented value of the local counter;

increasing a value of a summation variable by the incremented value of the local counter;

executing the iteration of the loop;

calculating a variance for the number of iterations per entry into the loop using the entry counter, the value of the summation variable, and the iteration counter to obtain an execution profile for the loop; and

compiling an optimized version of the loop using the execution profile.

11. The non-transitory computer readable storage medium of claim 10 , wherein the loop is one of a plurality of loops included in the computer program.

12. The non-transitory computer readable storage medium of claim 11 , wherein each of the plurality of loops is associated with a different execution profile.

13. The non-transitory computer readable storage medium of claim 10 , wherein compiling the optimized version of the loop comprises using the entry counter and the iteration counter to calculate an average number of iterations per entry into the loop.

14. A system, comprising:

a processor;

a physical memory; and

a computer usable storage medium having computer readable program code embodied therein, the computer readable program code adapted to, when executed by the processor, implement a method for executing a computer program, the method comprising:

obtaining a statement of the source code, wherein the statement comprises a method call, and wherein the source code is composed in a statically-typed programming language;

upon entry into a loop included in the computer program:

incrementing an entry counter by one;

for each iteration of the loop:

incrementing an iteration counter by one;

incrementing a local counter by one to obtain an incremented value of the local counter;

increasing a value of a summation variable by the incremented value of the local counter; and

executing the iteration of the loop; and

calculating a variance for the number of iterations per entry into the loop using the entry counter, the value of the summation variable, and the iteration counter to obtain an execution profile for the loop.

15. The system of claim 14 , the method further comprising, upon entry into the loop, setting the local counter to zero.

16. The system of claim 14 , wherein the entry counter, the iteration counter, and the summation variable are stored in the execution profile associated with the loop.

17. The system of claim 14 , the method further comprising using the entry counter and the iteration counter to calculate an average number of iterations per entry into the loop.

Assignments (2)
MERGER AND CHANGE OF NAME Recorded Dec 16, 2015
From: ORACLE USA, INC.; SUN MICROSYSTEMS, INC.; ORACLE AMERICA, INC.
To: ORACLE AMERICA, INC.
Reel/Frame 037311/0195 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jan 28, 2010
From: ROSE, JOHN
To: SUN MICROSYSTEMS, INC.
Reel/Frame 023863/0984 →
Continuity (1)
Related Publication 20110185347A1 · Jul 28, 2011