Linked by Thom Holwerda on Sat 26th Nov 2005 17:02 UTC, submitted by Megatux
Permalink for comment 65689
To read all comments associated with this story, please click here.
To read all comments associated with this story, please click here.
News
Linked by Thom Holwerda on 06/19/13 23:02 UTC, submitted by M.Onty
Linked by Thom Holwerda on 06/19/13 22:28 UTC
Linked by Thom Holwerda on 06/18/13 22:33 UTC
Linked by Anonymous on 06/18/13 22:26 UTC
Linked by Thom Holwerda on 06/18/13 22:25 UTC
Linked by Thom Holwerda on 06/18/13 17:45 UTC
Linked by Thom Holwerda on 06/18/13 17:32 UTC, submitted by poundsmack
Linked by Thom Holwerda on 06/17/13 17:58 UTC
Linked by Thom Holwerda on 06/17/13 17:52 UTC
Linked by Thom Holwerda on 06/14/13 21:03 UTC
More News »
Sponsored Links



Member since:
2005-07-06
> Java is *much* slower than C and C++.
But the point is, it's tough writing apps using C or C++, and even tougher to get other people to do it in their spare time. There's no "obviously better" solutions than using C or C++ for Gnome apps (and other infrastructure) -- but there are *marginally* better ones, IMO.
Hm...
Ok, here's the scenario: you've got GCC (including GCJ) installed on your GNU/Linux box. You write two neat GUI (GTK+) programs; one in C (or C++) and the other in Java. (The Java one is using the JavaGnome binding to Gnome/GTK+.)
Since you're using GCJ, you're compiling your Java code down to machine code -- just like with your C++ code. So, you end up with two binaries.
To run (for the first time), they both need to dynamically load their "standard libs" (in Java's case, I think this is libjava.so or something). Perhaps the Java one takes a moment longer to load than the C/C++ one. Dunno. Maybe libjava soaks up more memory than libstdc++ -- again, dunno.
At this point, both programs run pretty fast. Perhaps you're able to detect that the C/C++ program is just a tad faster. Remember -- they're both machine code. They've both loaded their std libs into memory.
Now the question to ask is, since the end result of both programs is pretty much comparable, how do you decide whether to write your Gnome programs in Java or C/C++?
- which was quicker to write? (probably the Java one)
- which had fewer bugs? (probably the Java one)
- which is more likely to get other folks contributing to and improving it? (probably the Java one)
- which is more portable? (arguably, the Java one)
- which was easier to build? (I'm thinking of ant here)...
Now, looking at the big picture, how much does it really matter if the C (or C++) version runs marginally faster?
BTW, I'm not a particularly big fan of Java. If it were me, I'd probably just knock it out in even *less* time using Perl and the Perl-GTK+ binding.