Ian Reddy
Progress Report
Hello Prof Lyon,
this week was more a sort of study week. I needed some good understanding of the Java Assist API set, I went through couple of documents with reference to Java Assist. On the other hand as I was more intended to modify byte codes, than source code (before class presentation), I had to go over the Java Virtual Machine specification book. Apart from this I also spotted some article over the net which I thought may improve performance as stated by a couple of them (before class). From articles on the Internet I found that : (even though I have not benchmarked these, as you pointed out in class)
#>In lining of private, static and final methods can lead to performance improvement.
#>If we consider the case below
for(int i=0; i<size(); i++) {
//body }
could be better written as
int s = size();
for(int i=0; i<s; i++){
//body
}
enhancement can be achieved
#>Consider
int n = (a*b) + c;
int x = (a*b) – c;
its better to use
int temp=a*b;
int n = temp + c;
int x=temp-c;
#>I also realized in the course of the thesis, I would make reference to native libs, so I had to go with a fall back algorithm
which states
if(native) {
//call native
}
else
{
//call Java methods
}
this would help to maintain portability.
#>unwinding of loops that use arrays, may contribute to the improvement in performance
#>Also there are several profilers available, if I could read the output file from the profiler and detect which methods uses maximum CPU time, this would help me to concentrate the optimization on the most essential part of code.
Well, later during the last week, I started writing program in Java Assist which I thought could take care of these preliminary optimizations (before your advise in class). As I thought such preliminary optimizations may contribute to enhance speed, and later implementation of the vectorization may add to the speed ups. The program that I wrote using java assist was capable of reading a class file, determine how many loops exist (even nested loops), and i was working on the unwinding of the loop body. After you pointed out a couple of things in class, I'm trying to re-iterate as to what i was doing.
thank you,
regards IAN.