Re: suggestion wanted for Java compiler evaluation

"Oliver Wong" <owong@castortech.com>
17 Jul 2005 13:51:42 -0400

          From comp.compilers

Related articles
suggestion wanted for Java compiler evaluation victor_york@yahoo.com (2005-06-12)
Re: suggestion wanted for Java compiler evaluation clemenr@wmin.ac.uk (2005-06-16)
Re: suggestion wanted for Java compiler evaluation owong@castortech.com (Oliver Wong) (2005-07-17)
| List of all articles for this month |

From: "Oliver Wong" <owong@castortech.com>
Newsgroups: comp.compilers
Date: 17 Jul 2005 13:51:42 -0400
Organization: GlobeTrotter
References: 05-06-071 05-06-087
Keywords: Java
Posted-Date: 17 Jul 2005 13:51:42 EDT

<clemenr@wmin.ac.uk> wrote
> <victor_york@yahoo.com> wrote
> > hello, everyone,
> > recently, I worked on a open source Java compiler project. After my
> > work, I wanna evaluate the compiler with some benchmark tools and
> > compare it with other popular Java compilers. could anyone give some
> > information about that?
> > thanks in advance
>
> How about my Java program for simulating the speciation and evolution
> of cichlid fish in the East African rift lakes. It's all in Java,
> fairly large (19,000 lines of java in the directory but not all of that
> is the program), and does massive amounts of work. If you could make it
> run faster than it does with Sun's java interpreter, then that would be
> an advantage to me, and I would do the benchmark tests for you.


        I'm assuming your compiler takes a program written in the Java
programming language and outputs class files.


        Because of the nature of the Java platform, it probably makes more
sense for your compiler to optimize for size than for speed. The
reason being that a lot of the optimization depends entirely on the
architecture of the system the program is running on. That's something
your compiler doesn't know (but a VM would, and which is why most of
the optimization should be done by the VM and associated
JIT-compilers).


        Besides, the main way to optimize for size is to put less bytecode
instructions in the class file, and less instructions to execute
(usually) has a side effect of being faster anyway.


        Also, measuring size the class file is relatively easy and
deterministic (as opposed to measuring speed). You may need to get a
class file disassembler; you want to count number of instructions,
rather than the number of bytes a class file takes up. If you want,
you can also assign different scores to instructions (make jump
instructions or invoke instructions more expensive than bitwise
comparison instructions, for example) to reflect the probable speeds
they'll run at on an actual CPU.


        For this task, you can probably download just about any other open
source Java program (there are lots out there), and just try to
compile them and see how small you can make your files.


        BTW, it's not hard to beat Sun's javac compiler; I wrote a java
compiler back in university which was significantly more optimized
(both in terms of size and speed) over the poor way in which javac
handled string concatenation, for example.


        - Oliver


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.