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


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

Re: libGCJ




On Sun, 11 Nov 2001, james_williams wrote:
> I am currently considering building an environment (I know another one) 
> that would sit on top of linux.  The reason for my email is that I am 
> considering writing the environment in java and using libGCJ to compile 
> it natively so that it would at least be usable (in terms of 
> performance).  A workmate of mine and I both agree that C++ is 
> undoubtably a good tool for this job, but I'm wondering about your 
> thoughts of why I should or should not use java (compiled to native 
> code) for this.  

There are many things to consider depending on the needs of your
application.  I doubt if a discussion/debate of c++ vs. java is really a
appropriate use of this list.

That said, performance will likely not be the most important factor.
Construction and maintenance costs should usually be considered first.
(Your comment "...compile it natively so that it would at least be usable"
suggests you are biased negatively on Java, rightly or wrongly.)

> I have been investigating your libGCJ website, and am very impressed by 
> the feedback and some of the projects done with libGCJ.  I'm wondering 
> if you guys have done any "benchmark" tests against native compiled java 
> vs C++.

Several benchmarks and results have been posted before to
java@gcc.gnu.org, search the archives for more info.  You won't find many
C++ vs. Java benchmarks, given that the languages are substantially
different and it is hard to find meaningful comparisions.  In those cases
where I have compared the results of small routines translated directly
from C++ to Java, I find few differences in the code generated by g++ and
gcj (though the more rigid semantics of Java tend to pessimize the code
slightly, these effects are probably negligible on most real-world tests).

Of course compiler quality is no guarantee of performance considering the
influence of the language runtime, particularly GC.  You need to be
careful in your assumptions about compiled languages and performance.

Feel free to ask specific questions about libgcj on the GNU java
discussion list, java@gcc.gnu.org.  You'll likely get more help there
than from the gcc list.

Jeff


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