public class CompilerDNA extends Object
The DNA tells the AOS two important kinds of averages for each optimization level: the cost of compiling at an optimization level (as measured in bytecode/milliseconds) and the expected speedup of the resulting code (relative to the first compiler).
There is an AOS command-line option to set the compiler DNA. The method
readDNA(java.lang.String)
contains a comment on the expected format.
This DNA was gathered on July 9, 2008 using revision r14679 + the bugfix in r14688. The PowerPC data was gathered on piccolo.watson.ibm.com (JS21, machine type 8884; ppc64-aix). The IA32 data was gathered on lyric.watson.ibm.com (LS41, machine type 7972; x86_64-linux).
Modifier and Type | Field and Description |
---|---|
static int |
BASELINE |
private static double[][] |
benefitRatio
Benefits of moving from one compilation level to another
USAGE NOTE: The data is layed out in a upper triangular matrix
|
private static double[] |
compilationRates
Average bytecodes compiled per millisecond.
|
private static String[] |
compilerNames |
private static double[][] |
compileTimeRatio
Compile time ratio of one compilation level to another
For example, if compiler1 (say OPT1) compiles at 50 bc/msec
and compiler2 (say OPT2) compiles at 100 bc/msec,
compileTimeRatio[OPT1][OPT2] = 2
USAGE NOTE: The data is layed out in a upper triangular matrix
|
private static int |
numCompilers
The number of compilers available
|
(package private) static int |
OPT0 |
(package private) static int |
OPT1 |
(package private) static int |
OPT2 |
private static double[] |
speedupRates
What is the execution rate of each compiler normalized to the 1st compiler
|
Constructor and Description |
---|
CompilerDNA() |
Modifier and Type | Method and Description |
---|---|
static double |
estimateCompileTime(int compiler,
NormalMethod meth)
Estimate how long (in milliseconds) it will/did take the
given compiler to compile the given method.
|
static double |
getBaselineCompilationRate()
Returns the compilation rates of the baseline compiler in
bytecodes/millisecond.
|
static double |
getBenefitRatio(int compiler1,
int compiler2)
This method returns the expected speedup from going from compiler1 to compiler2
|
static int |
getCompilerConstant(int optLevel)
maps opt levels to the compiler
|
static String |
getCompilerString(int compiler)
maps a compiler constant to a string
|
static double |
getCompileTimeRatio(int compiler1,
int compiler2)
What is the additional overhead (relative to compiler1 compile time)
of compile2 compile time.
|
static int |
getNumberOfCompilers()
returns the number of compilers
|
static int |
getOptLevel(int compiler)
A mapping from an Opt compiler number to the corresponding Opt level
|
static void |
init()
initialize static fields
|
private static void |
initializeCompilerRatioArrays() |
private static void |
processOneLine(LineNumberReader in,
String title,
double[] valueHolder)
Helper method to read one line of the DNA file
|
private static void |
readDNA(String filename)
Read a serialized representation of the DNA info
|
private static final String[] compilerNames
public static final int BASELINE
static final int OPT0
static final int OPT1
static final int OPT2
private static int numCompilers
private static final double[] compilationRates
private static final double[] speedupRates
private static double[][] benefitRatio
private static double[][] compileTimeRatio
public CompilerDNA()
public static double getBenefitRatio(int compiler1, int compiler2)
compiler1
- old compilercompiler2
- new compilerpublic static double getCompileTimeRatio(int compiler1, int compiler2)
compiler1
- the compiler whose compile time we compare tocompiler2
- the compiler's compile time we care aboutpublic static double estimateCompileTime(int compiler, NormalMethod meth)
compiler
- the compiler to compile methmeth
- the method to be compiledpublic static double getBaselineCompilationRate()
public static void init()
private static void initializeCompilerRatioArrays()
private static void readDNA(String filename)
filename
- DNA filenameprivate static void processOneLine(LineNumberReader in, String title, double[] valueHolder) throws IOException
in
- the LineNumberReader objecttitle
- the title string to look forvalueHolder
- the array to hold the read valuesIOException
- when there's a failure during processing of the filepublic static int getNumberOfCompilers()
public static int getOptLevel(int compiler)
compiler
- the compiler constant of interestpublic static String getCompilerString(int compiler)
compiler
- the constant for the compilerpublic static int getCompilerConstant(int optLevel)
optLevel
- opt level