Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / December 2005

Tip: Looking for answers? Try searching our database.

can I compile java to a platform

Thread view: 
timasmith@hotmail.com - 21 Dec 2005 05:48 GMT
My understanding is that on some platforms like AIX they can change
java from being an interpreter to running binaries through some
compiler?

Not sure of the details but is it possible to compile my java program
for Windows - to make it faster?

thanks

Tim
Roedy Green - 21 Dec 2005 06:39 GMT
>Not sure of the details but is it possible to compile my java program
>for Windows - to make it faster?

see http://mindprod.com/jgloss/aot.html
http://mindprod.com/jgloss/nativecompiler.html
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.

Jonathan Bartlett - 21 Dec 2005 17:18 GMT
> My understanding is that on some platforms like AIX they can change
> java from being an interpreter to running binaries through some
> compiler?

Just FYI -- compiling something doesn't necessarily make it faster.  In
fact, there are some cases where JIT beats compilation, because it can
perform runtime performance enhancements that statically compiled code
cannot.  And, even without that, a good interpretter beats a bad compiler.

My suggestion is that if you are looking specifically for speed,
benchmark your code under several systems, and don't worry about whether
it is compiled or not.

Jon
----
Learn to program using Linux assembly language
http://www.cafeshops.com/bartlettpublish.8640017
Oliver Wong - 21 Dec 2005 21:35 GMT
> My suggestion is that if you are looking specifically for speed, benchmark
> your code under several systems, and don't worry about whether it is
> compiled or not.

   Also, profile your code. Don't make random optimizations all over the
place.

   - Oliver
Alun Harford - 22 Dec 2005 02:20 GMT
> My understanding is that on some platforms like AIX they can change
> java from being an interpreter to running binaries through some
> compiler?
>
> Not sure of the details but is it possible to compile my java program
> for Windows - to make it faster?

Yes, you can pre-compile it.
But it will almost certainly be slower (do you think Java is JIT compiled
because it's a fun thing to do?)

Alun Harford
Luc The Perverse - 22 Dec 2005 03:17 GMT
>> My understanding is that on some platforms like AIX they can change
>> java from being an interpreter to running binaries through some
[quoted text clipped - 6 lines]
> But it will almost certainly be slower (do you think Java is JIT compiled
> because it's a fun thing to do?)

Actually yes - at least I do.

I believe that the purpose of bytecode is to be compatible between systems -
to be a standard.   If JIT compiled code were always faster, or even usually
faster as you seem to be implying there would be no native compilation
systems out there.  C++ would be made to compile to program to be used by a
virtual machine, to improve performance!!

You can say JIT is sometimes faster, negligibly slower,

--
LTP

:)
Oliver Wong - 22 Dec 2005 18:38 GMT
> I believe that the purpose of bytecode is to be compatible between
> systems - to be a standard.   If JIT compiled code were always faster, or
> even usually faster as you seem to be implying there would be no native
> compilation systems out there.  C++ would be made to compile to program to
> be used by a virtual machine, to improve performance!!

   C++ is somewhat of a special case, because it's an older language and
yet remains in use in practice. That it is older means the language itself
suffers from problems we are now able to solve more elegantly in language
design theory (like avoiding ambiguity and keeping the grammar context
free), and so there is low academic interest in it (i.e. not much high-level
research being done for it). The fact that it's still in use in practice
means that a lot of low-level research in optimizing it has been done by
people in the industry.

   I think we're hitting the limits of our capabilities to optimize C++,
while we still have lots of research to be done in optimizing higher level
languages.

   Actually, Java might be hitting some limits too. There is some effort to
come up with a new intermediate representation for Java (i.e. something
other than bytecode). One contender is called "Jimple", which is a variant
on the representation known as "SIMPLE" with some Java-specific tweaks.
Jimple is believed to be more easy to optimize than bytecode.

   Check out SOOT (http://www.sable.mcgill.ca/soot/), which is an
optimization framework which takes a .class file, converts it to Jimple
format, does some optimizations to it, and converts it back to .class file
(actually, to be more correct, it supports 4 different intermediate
representations; not just Jimple). Ideally, you'd want to keep it in Jimple
format, and run your JIT against the Jimple code instead of bytecode.

   - Oliver
Alun Harford - 24 Dec 2005 03:14 GMT
>>> My understanding is that on some platforms like AIX they can change
>>> java from being an interpreter to running binaries through some
[quoted text clipped - 14 lines]
> compilation systems out there.  C++ would be made to compile to program to
> be used by a virtual machine, to improve performance!!

Get a compiler that takes Java and compiles it into any machine language you
want. Compile a few Java programs you use, and then tell us whether they're
faster, or slower, than the Sun JVM.

(they'll be slower)

Alun Harford


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.