[NTLUG:Discuss] Need some inputs on porting.

Steve Baker sjbaker1 at airmail.net
Tue Sep 30 12:32:42 CDT 2003


Stephen Davidson wrote:

> Now a days, Java is just as fast (and in many cases is faster) than C/C++.

Wooaahhh. That has to be HEAVILY qualified (and I'm trying hard not to
start a language war here).

For CPU intensive tasks where most of the time is consumed in the language
itself (ie not waiting for hardware and not inside libraries that are not
written in JAVA)...then JAVA is at least 50 times slower than C++.

If your application DOES spend most of it's time inside some other 'time
sink' then JAVA can come close to the speed of C/C++ - but that's only
because JAVA isn't doing anything - it's all being done by libraries that
were almost certainly written in C/C++ and the JAVA code is just the 'glue'
that holds together the parts that are doing all the work.

So, it could *almost* tie with C/C++ for speed under those special
circumstances - but there are no cases that I can imagine where JAVA
would be faster than C/C++ (unless maybe there are JAVA libraries written
in C/C++ that are somehow better written than the equivelent C/C++ library -
but that's a feature of the libraries - not of the language itself).

That's not to say that JAVA is not the best choice in this case - speed
isn't everything.

---------------------------- Steve Baker -------------------------
HomeEmail: <sjbaker1 at airmail.net>    WorkEmail: <sjbaker at link.com>
HomePage : http://www.sjbaker.org
Projects : http://plib.sf.net    http://tuxaqfh.sf.net
            http://tuxkart.sf.net http://prettypoly.sf.net
-----BEGIN GEEK CODE BLOCK-----
GCS d-- s:+ a+ C++++$ UL+++$ P--- L++++$ E--- W+++ N o+ K? w--- !O M-
V-- PS++ PE- Y-- PGP-- t+ 5 X R+++ tv b++ DI++ D G+ e++ h--(-) r+++ y++++
-----END GEEK CODE BLOCK-----




More information about the Discuss mailing list