This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: first test



Am 14.07.2004 um 23:28 schrieb Bryce McKinlay:


Alessandro Di Maria wrote:

running it on Mac OS X 10.3.4 1.33 GHz G4:

java Loop
time: 2269

gcj --main=Loop -o Loop Loop.java
./Loop
time: 4369

??? the app compiled with gcj is twice as much slow as the one running through the VM ???
Redoing the test doesn't change much.


Have I done something wrong?


You didn't say what version of gcj you are using, but until very recently, gcj on Darwin (aka OS X) was very slow because it lacked support for converting signals into NullPointerExceptions. This meant that it had to insert an explicit check for null pointers every time an object is accessed. You need to use the latest gcc from CVS to get the new code, I don't think it has been added to the GCC 3.4 branch (yet?).

Also, you should compile your code with -O2 to get the best performance, however in this case it probably doesn't make much difference because the vast majority of runtime is spent in the various library calls.


Configured with: /Volumes/Work/gcc/src/gcc-3.4.1/configure --prefix=/usr/local/gcc-3.4.1 --enable-shared --disable-checking --enable-languages=c,c++,java --enable-debug
Thread model: posix
gcc version 3.4.1


I'm new to GCJ, normally I develop only on Java and wanted to test GCJ.
So just for curiosity, what does -O0 and -O2 mean?

I tried to compile and link in two seperate steps and get different times, but quite the same as with -O2:
time: 3410


Regards
Alessandro


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]