Although, because of its prominence, Java gets a lot of attention and with it much criticism (some of it valid), many don’t realize that some big breakthroughs have arrived and that the Java development landscape is solving important problems. Also, Developer.com posted their “product of the year” awards for 2006. Java related products have the strongest showing with the largest number of awards.
First, to get swing performing as well in linux as it does in windows. I’ve been on a guest computer with similar specs as my own, but running windows. It was really surprising to see how much better swing applications ran even with about half the memory of my home computer.
Next, for trolltech to finish up their qt bindings for java. I wasn’t really happy with the performance of the unofficial bindings but am hoping that trolltech might be able to put some more polish into it.
First, to get swing performing as well in linux as it does in windows.
i think desktop apps is not the number one target for java. Java has it’s power on server and web-application and i think there they will have a long and successful live.
On Desktop:
– windows people have Delphi, VisualBasic, VisualC++ and .Net
– on MacOS people have coca
– on GNU and BSD Systems people have Gtk+ and Qt
– for cross-plattform people have Qt and wxwidgets
I think very few people have picked Java for desktop apps and i don’t think this will change.
Supposedly 6.0 is focused heavily on desktop apps. I think “very few people” may be an understatement, you might just not be the target crowd of Java desktop apps. Besides the well known Java apps (Eclipse, Azureus, Limewire, etc.) a nice showcase is Swing Sightings (http://java.sun.com/products/jfc/tsc/sightings/).
The same is with FreeBSD and other *BSD’s. Last time i checked, there even was no native java for my fBSD box. When i launched NetBeans, it took ~300MB of my 128MB ram.
… i had to make one realy small app for university .. it took me 3 hour, just because nothing was working.
I hope it has changed a bit, tomorrow I’ll try again.
>> Eclipse, Azureus, Limewire, etc.
Eclipse and Azureus don’t use JFC/Swing, those are SWT-Apps.
That doesn’t change the fact that they are written in Java. I don’t believe the parent was saying all of those apps were Swing based.
Edited 2006-01-14 12:53
You could try gtk-java or maybe even C# with GTK#. I hear that Fedora will include mono with C# and GTK# libraries in the next release. Perhaps the “java is dead” part is not that far off on the Linux platform.
Edited 2006-01-14 01:11
The main use for Java is on the serverside, the main use of Linux so far have been as server. Because of this I would say that Java is not even close to being dead on Linux.
In fact I would say it has a great potential for growing. Up until the soon to be released Java 6, it have not been possible to make full use of the keyboard unless you were using an US keyboard and US locale in Linux. No wonder that so few people wrote java desktop applications.
As this gets fixed in 1.6 (it is allready fixed in the Mustang snapshots), and things like system tray gets supported and speed and memory foot print improves, java stand out as a very good cross platform alternative.
Another factor that makes it look like Java have a bright future, is that gcj and gnu classpath are starting to take off. Today, it is possible to build complex applicaions like Eclipse using free gcj software. So there will be free alternative available for people that prefer that.
Edited 2006-01-14 03:20
>Perhaps the “java is dead” part is not that far off on the Linux platform.
What do you smoke? 😉
Eclipse IDE – is most popular IDE
java is most popular language on source forge.
Azureus bittorent client – most popular sourceforge.net
project.
Welcome back to earth man.
I simply love this language.I don’t know why.I was doing for about 5 years C/CPP (under MacOS) and when I got a job where they offered Java training I simply stuck on it.Is extremely simple and basically worked everywhere for me. Sourceforge is indeed,not a measure, but it say a lot about how popular Java is.
But that’s just me.
…near ubiquitous on pretty much every major system. That’s what I like about the platform, but what turns me off is Java the langauge.
I would take Groovy with robust IDE integration over Java, all things being even. Once you start writing Boo, IronPython, Ruby, etc, having to write Java is like a big ol’ smack in the face.
Now, I like the occasional smack in the face. Its kinky. But not all the time.
> I simply love this language.I don’t know why.I was
> doing for about 5 years C/CPP {snip}
I went through somewhat the same thing when I too switched from C++ to Java. I just couldn’t get over how nice it was that they took out so much of the nasty stuff in C++, and left a smaller, simpler language in its stead.
The romance lasted until I learned Python and went through the whole thing again but this time with s/C\+\+/Java/ig and s/Java/Python/ig.
Besides just elegance and simplicity of a language though, another not unimportant factor is actually the community. There’s a *big* difference between the Java and Python communities (well, except for the uber cool GCJ people who share a similarly high hacker index with the Pythonistas).
Edited 2006-01-14 03:33
I like creating cross-platform DESKTOP apps in Java. I create apps that must run on multiple platforms and communicate with multiple DBMS’s (Oracle, Sql Server, MySql, Postgresql). I think this is where JDBC simply shines. By using pure java JDBC drivers that I include with the app, I can simply drag-and-drop the app to different OS platforms. Otherwise it would be a pain to setup all the client libraries for all the DBMS’s on all the platforms. Go Java!
Most of the FUD being spread on these forums how “bad” Java is on the desktop is just that “FUD”. Java on the desktop is absolutely fine and if well developed you wouldn’t be able to tell a Java app from a native app. Modern Java runtimes (J2SE 5) do an excellent job at making Java applications run fast while not consuming a whole lot of resourses. Look at how well NetBeans works and looks as an example. Developing Java apps for the desktop is also a no brainer especially if you use an IDE.
BTW, as soon as NetBeans 5 comes out with Matisse, developing desktop Java apps will be no more difficult than using VB.
> Perhaps the “java is dead” part is not that far off on the Linux platform.
Ha, ha. Dude you’re just a freaking idiot. You’re probably a bonehead that never even used Linux outside of your home desktop. In the enterprise space there are a lot (actually a majority) of desktop apps written in Java. As an example all of Oracle desktop application are written in Java, a lot of SAP stuff on Linux is in Java, almost all of desktop utilities offered by IBM for WebSphere are written in Java, the list goes on… I’m yet to see any serious app on Linux being written in Gtk# or any amaturish crap like that. Get over it Mono will never gain traction against Java, Mono doesn’t have anything to offer to be a worthwhile alternative.
Most of the FUD being spread on these forums how “bad” Java is on the desktop is just that “FUD”. Java on the desktop is absolutely fine and if well developed you wouldn’t be able to tell a Java app from a native app.
Sure you can tell a java desktop application from a native C++ application using GTK. The Java one takes 5 minutes to load and the native application loads in less than a second.
Thank you for the java lesson at where I can still find it. I almost forgot that I spent three years developing Java servlets back in the dot com rush but I got tired of waiting for my Java servers to finish loading after 15 minutes passed and so I gave up Java programming and now mostly work with Python and GTK but now I have started to move towards C# and GTK for larger applications. Java is still pretty much where I left it stuck on the server side. The same mantra Java developers preached back then is still exactly the same. Sure it takes lots of memory and it loads slowly but once it is done loading a gazillion objects it is near C++ speed! Lame. When C# takes over in the next couple of years and you need a job drop me a line and I will try and hook you up with some work. You have a good spunky attitude. Go get ’em killer.
Edited 2006-01-14 04:16
> Thank you for the java lesson at where I can still find it. I almost forgot that I spent three years developing Java servlets back in the dot com rush but I got tired of waiting for my Java servers to finish loading after 15 minutes passed and so I gave up Java programming…
Oh gee, it looks like either you’re a bonified idiot or just someone who doesn’t know shit about Java servlets. I bet the “three year experience developing servlets” is pure BS. So that you know Java Servlets load only once on Web Container startup, then there is zero wait since the servlets are compiled and preloaded in memory. Servlets is the absolute fastest technology for execution of web content bar none and this is why Java became so fenominally popular in the enterprise for very high workloads. Don’t lie about something you have absolutely no clue about!
> When C# takes over in the next couple of years and you need a job drop me a line and I will try and hook you up with some work. You have a good spunky attitude. Go get ’em killer.
Ha, ha, wake up you idiot. MS was promissing to overtake Java a few years ago in that department. What happened? Nothing, Java is still #1 language stomping over .NET all over the place. Growth of Linux and never stopping disgust with MS will propel Java even further in the coming years. .Net will always be relegated to the realm of MS-loving ignorant boneheads who just don’t know any better.
Hey, ease up on the name calling. BTW, Java is dead slow on startup. It’s unavoidable. And it’s a memory hog. These things you cannot deny. Even though I don’t like MS, it wouldn’t be too bright to underestimate what they do. C# came about because MS wanted to expand Java. Sun stopped them. Now tell me who is being more progressive? To say Java is stomping over .net is not seeing the big picture.
BTW, what do you mean about servlets being the fastest technology for execution of web content? If you’re talking speed, plain C beats Java. Heck, Perl beats Java for most of this stuff. The speed myth is bunk. Dead. The only time Java gets near C/C++ speed is when you give it copious amounts of RAM. And even then, there’s no guarantee.
Also, when people get defensive, it’s obvious they’re hanging on by a thread. No disrespect to Java and .net users, but these are dead-end technologies. These companies are sucking whatever money they can out of it because the only people using this stuff is people that weren’t around during the last generation when these things also didn’t take hold. It’s all 40 year old technology. You’re repeating history. I’ve already read the history books, so I already know how this is going to end. Good luck! You’re going to need it.
BTW, what do you mean about servlets being the fastest technology for execution of web content? If you’re talking speed, plain C beats Java.
Actually, no, Java is quite a bit faster than C in these situations. Why? Because Java servlets merely need to create a thread. With C you have to spawn an entire process. Unless you are doing a LOT of processing in the code, that is almost certainly going to take more time than running C code can make up for.
Of course, the first time the servlet runs it is very slow, but after it has been compiled and stored in memory it is quite fast.
About fastest execution of web content:
Actually, no, Java is quite a bit faster than C in these situations. Why? Because Java servlets merely need to create a thread. With C you have to spawn an entire process. Unless you are doing a LOT of processing in the code, that is almost certainly going to take more time than running C code can make up for.
I fail to see why C must create a new process every time. I can easily create modules for Apache and in IIS, I’ve written many dll’s that remain resident. Forgive me if I don’t follow your argument.
Actually you’re right. I must have been half asleep when I wrote that post. I was thinking about old cgi vs servlets, not C in general.
Java is currently the main language used in teaching at universities. That makes for a dominance in many free projects.
When the web server technologies were raving in the late 1990ies it was java to fill in gaps – like migration of threads and object persistance. Many commercial projects started back then – being stable now.
Both these sources make for a contemporary dominance – but that should not be taken as a sign that java is the primary language in the future. The biggest problem in the java world is not the syntax – instead it is still lacking a common object format and a portable runtime with a common subset for mobile, desktop and server applications.
Apart from these I know quite a number of concepts that are still missing in the mindset of java developers. Querying source code (like a database), contract programming (microsoft has a research update of c#), type inference to name just a few. Sadly, I happen to meet lots of people who think that programming on interfaces is the best thing in the world. Need an update?
What does this section mean in the article
“For those people who really like PHP, keep it: Java 1.6 makes it the reference implementation for the new web scripting language bindings, so you can do your web views in PHP and use Java for model and controller.”
First I’ve heard of that.
I love using Java. I love the idea behind the technology. I just wish that some things changed like faster start up speed. Once it gets going it is as fast as C++ code if not faster. So performance in that respect is not a problem. One thing I would like to say is that because Java is evolving so darn rapidly, some actions are becoming rather mechanical and thus resulting in a lot of boilerplate. That is where a badass IDE needs to come in. NB 5 is a great great great step forward in that direction. And I have been reading that all Sun’s IDEs are going to merge in to Netbeans…so all the missing features like UML etc etc will be soon available. Eclipse is great as well but I find NB just easier to use with the most features right out of the box. That there are more projects in Java at sourceforge and that Java products are winning a lot of awards is a testament to how good the language is. However let us not make the misake of using Java in every aspect of programming. Sometimes it is just not the right tool to use.
well… my problem with java is that it’s always going to be so great. in the next release
(and i’m not saying it’s awful, but that it’s a complex product that always has – and will have, for instance – it’s quirks)
Unless SUN cleans up Java so that I don’t need a dual opteron to run my apps, I won’t use it anymore.
I hate java.nio
NIO has been designed by people who had been smoking too much.
What I like in Java over the majority of other languages is the synchronized method. Synchronized saves lives. Well, as long as you can use it. I can even imaging why a lot of multithreaded applications out there are so damn slow. Instead of encapsulating only instructions which could lead to side effects due to lost sync ppl just encapsulate the whole method.
Java & Python are the feature. I really like the fact that also Jython exists – there are situations where you write with java 300 lines and in python those are 50.
On the other side CPython is available for most plattforms, Sun JRE and its mods not. I hope Kaffe/GCJ/Classpath will create a very performant 100% compatible RE soon! If the compiled binaries will provide good performance, too, then nothing stands in front of Java anymore!
As for JFC/Swing: are there actually important applications (except LimeWire and Netbeans and JBuilder) which seriously use it? o_O Well, if 6.0 will make Swing fast, the java package will be complete.
Are there distributions that include java applications within their package management? e.g. does “smart install eclipse” work out of the box?
Yes. apt-get install eclipse works on Debian testing, and Ubuntu Breezy and yum install eclipse should work on Fedora Core 4 and later.
cheers,
dalibor topic
Hi,
a very interesting article. I’ve written some applications with Java, primarily on client side. On server side java was too complex for my more or less small projects.
I played around with .NET ans ASP.NET and it was very easy to create a webpage with it. Sure, it is very complex too, but the development process is fast and I don’t have to learn so many new things. Don’t have to configure a Tomcat, or anything. It simply worked. Struts and all this was too much to learn for a small web-application. PHP was much easier for me.
I’ve never heard of Struts Shale, or Struts Ti, Velocity, Freemarker, Groovy, or Groovelets.
> For those people who really like PHP, keep it: Java 1.6 makes it the reference implementation for the new web scripting language bindings, so you can do your web views in PHP and use Java for model and controller.
?? PHP with Java? Very nice too. I am really happy to see all this in the article. Because I am one of the people, who thinks, that the development of java sleeps and that .NET is the better platform.
And for desktop apps with a GUI: Well.. don’t know. I’ve made some apps, but they were very slow. I primarily use it on linux. As I read before, Swing uses Gtk on linux in Java 6. So, let’s see, how this will perform.
And I hope, that in the next JDK the memory usage is reduced. Eclipse uses nearly 200 MB here. And please don’t tell me, that I should have enough RAM, and that I normally have enough free RAM, that can be used now. I’ve tried .NET and it is faster and uses less memory. So would be nice having a similar process in Java too.
Greetings
Mike
“Eclipse uses nearly 200 MB here. [snip] I’ve tried .NET and it is faster and uses less memory.”
You are aware that Eclipse is an IDE, while .NET is a platform – and that the two don’t compare ?
Both .NET and Java use more memory than their c/c++ counterpart – for obvious reasons. Live with it.
In a small test here:
Eclipse: 37.344 MB ram
#develop (not even close in features to eclipse): 55.788MB ram
Once again we shoot down some random .net > java claim *sigh*
Hi,
I simply compare .NET to Java, because .NET feels faster than Java. Don’t know, why you only have 37MB RAM usage. Is it Windows, or Linux?
That both .net and java use more memory than c/c++ is clear.
Mike
Wow, eclipse just using 37MB on your machine? Tell us your secret!
I opened eclipse… without any views open – same as #develop, so basic ide vs basic ide – instead of Eclipse with a gazillion features vs #develop with 10 features (or so).
(edit, now sharpdevelop is down to about same level *ponder*)
http://matzon.dk/brian/tmp/eclipse-sharp.png
>Wow, eclipse just using 37MB on your machine? Tell us your secret!
There is no secret, remove all unused plugins.
Turn of automatic background compilation.
Use latest stable Eclipse IDE (check for updates from time to time).
Both .NET and Java use more memory than their c/c++ counterpart – for obvious reasons. Live with it.
In a small test here:
Eclipse: 37.344 MB ram
Exactly, which is why they suck, which is why my Free Pascal project gets stacks of new users: the advantage of C++ and Java combined
In a small test here:
Free Pascal IDE: 7596 kb ram
Seriously, a language that is incompetent with memory usage is seriously limited in it usability. 37 MB is doable, but if the language is inneficient for a 37 MB application, it is also inefficient in situations where memory does matter. Imagine a computer game using 8 GB instead of 256 MB.
Managed languages: been there, done that, it didn’t work: the USCD p-system.
Exactly, which is why they suck, which is why my Free Pascal project gets stacks of new users: the advantage of C++ and Java combined
In a small test here:
Free Pascal IDE: 7596 kb ram
Right, and your Free Pascal IDE has all the features that Eclipse has? So you’ve got quick fix, refactoring support, automatic background compilation, and on the fly error highlighting? Apples to oranges, friend.
The compiler is in memory. The debugger is in memory. There is a HTML renderer in it, to make people browse the help files. It has on the fly error highlighting. It has code completion, code templating, symbol browsing. It does not have background compilation because it compiles 8-10 times faster than GCC, don’t need it. It doesn’t have refactoring as well.
No magic feature will make it ever require 37MB. Because that 37MB of Eclipse is not because of features, but because of memory waste. And 37MB is already optimistic, according to some posts here.
FreePascal is really cool and my prime choice for developing client-side apps
Seriously, a language that is incompetent with memory usage is seriously limited in it usability. 37 MB is doable, but if the language is inneficient for a 37 MB application, it is also inefficient in situations where memory does matter. Imagine a computer game using 8 GB instead of 256 MB.
Well the overhead of the JVM + memory pools is always going to be fairly constant. The more memory you use the smaller the percentage of overhead of the JVM will be. Even if it was exagerated 8gb is a stupidly high figure and you have far bigger concerns in terms of performance elsewhere.
Mike I agree with the memory usage. When I run NB 5.0 RC1 I see the JVM taking a 127 mb of memory whereas the in-IDE memory monitor shows NB taking up 48 mb max of the heap space. And the gc works quite awesome in the background without interrupting my work. I think the reason is why the JVM takes up so much memory is because it loads up all the libraries in memory so disk usage is nil. That is a great idea IMHO because disks are amazingly slow. But yes I hope Mustang builds are easier on the memory usage as well.
“Once it gets going it is as fast as C++ code if not faster”, please, step away from the crack pipe.
There are some good things going on with Java, speed is not one of them.
Are you serious? Are you reading stupid microbenchmarks or are you thinking of startup speed? Why do you think a lot of scientific apps are going to Java then? There is now almost no difference in speed between java and C++. If you are a horrible code writer then sure you are going to see no advantages with Java. In Java you have to code with performance in mind which should be the same as in all languages.
There is now almost no difference in speed between java and C++. If you are a horrible code writer then sure you are going to see no advantages with Java.
The only conclusion I can draw from this is that there must be a lot of horrible Java coders out there then
“The only conclusion I can draw from this is that there must be a lot of horrible Java coders out there then “
Anything compiled directly to machine code is going to be intrinsicly faster, and use less memory, than anything compiled to intermediate byte code to be interpreted by a VM.
That said, the aforementioned Netbeans, even though it loads slowly (it’s a huge program), is very fast once loaded. Azureus is very fast. Limewire, RSSOwl, JEdit, DrJava, HotJava Browser, IntelliJ IDEA, Eclipse (once loaded), and many other Java programs, are all quite fast.
On the flip side of the coin, while C++ apps are usually faster than Java or C# (or interpreted scripting langauges), there are some C++ apps that are not so fast, and some that are quite big, slow loading memory hungry applications – including MS Office, OO.o, Mozilla/Firefox, Kdevelop, and a host of others.
Does this mean that C++ apps are slow by nature? Of course not. It just means that apps coded in any language are capable of being slow and bloated. And, of course, some VM apps can be quite speedy.
The bottom line is that Java has come a long way, and has been optimized very, very well. And at the hands of skilled coders, and coders who are aware of how Java threading, garbage collection, and the GUI libraries work, Java apps can be quite fast and efficient.
That said, the aforementioned Netbeans, even though it loads slowly (it’s a huge program), is very fast once loaded. Azureus is very fast. Limewire, RSSOwl, JEdit, DrJava, HotJava Browser, IntelliJ IDEA, Eclipse (once loaded), and many other Java programs, are all quite fast.
The only one of these apps I have any real experience with is Jedit. Although it runs decent, I wouldn’t exactly call it fast. Run it side-by-side with Ultraedit and you’ll see what I mean. Granted Ultraedit doesn’t have quite as many features as Jedit, but even if it did, it probably wouldn’t slow things down at all. Jedit also sticks out like a sore thumb, at least on a Windows box. Even if you set it to the Windows look & feel, it’s still not even close. Check the following link for more info:
http://www.monroeworld.com/forums/showthread.php?p=32720&highlight=…
I used to really not like Java at all. I did not like it’s full object orientation, the idea of garbage collection, the large memory imprint of the JVM, slow and ugly Swing/AWT apps, and J2EE complexity.
But that has changed.
First, Java has really improved. The JVM has improved it’s speed as well as JIT compilation. Swing has improved immensely, in both speed and appearance. SWT is really good, since it uses native GUI libraries and still maintains cross platform capability. The Garbage collector works better now. Also, I’ve been seeing more and more really nice Java GUI apps, like NetBeans (using Swing), Eclipse (using SWT), Limewire (using Swing), Azureus and RSSOwl (both using SWT).
Second, I’ve learned more and more about programming Java. I’ve become more accustomed to it’s full object orientation. I like the Java threading model. I’ve learned about server side Java – JSP, Servlets, JNDI, RMI, EJB, Spring, Hiberate, Struts, etc and learned just how powerful those APIs really are – they can do so much more than PHP and ASP (or even Perl). And I’ve gotten used to using all of these technologies.
And Java just keeps going strong. It’s only being used more and more in all capacities. It’s not as trendy or news worthy as hot tech stuff like AJAX or Ruby on Rails – it’s mature, ubuqitous, standardized, and almost boring because it’s so effective, common and powerful.
I like Java but the only good desktop apps are Java IDEs. Eclipse and Netbeans are being developed by the very best programmers in the Java community and even then Netbeans using Swing is only now running at a decent speed. Azureus and Limewire are both noticeably sluggish compared to any of their C counterparts.
Anyway that’s 4 notable apps compared to thousands of them written in C.
Java apps are a tiny insignificant minority on the desktop and arguing otherwise is just wishful thinking.
I like the scripting languages, particularily PHP and Perl, and a little big Ruby.
However, the media, and many programming “gurus” or pundits, have been hyping scripting languages, particuraily Ruby on Rails, being the next great thing, and will eventually replace Java.
While these languages/frameworks have provide some easy solutions, I have yet to see them making an impact in most “real life” examples, particularily in the job market. For instance, go to Dice.com (or Monster, or HotJobs, or Craig’s List, etc), and do searches on particular languages and/or technologies. I do searches on my local area (Sacramento, CA area), and here is what results for some of the major languages:
Java: 80-100 (range, depending on what week it is)
C#: 50-60
VB: 35-40
C/C++ 30-35
Perl: 10-15
PHP: 5
Python: 1-2
Ruby: 0
I get similar results, only on a much larger scale, when I do searches nationaly.
So, for most Programming jobs, it’s either Java or .Net, with some C++ (typically for either Windows stuff or systems level stuff), with some scripting languages thrown in for good measure (mostly Perl, for either Unix admin or for web development).
And, for the most part, Java remains the most popular language in the business world. There’s been a big uptick in VB/C# .Net lately, but that is mostly people porting legacy VB6 or VC++6 stuff up to .Net.
I use Java to perform numerical simulations. I previously used Fortran95, Python+Fortran95, and C++, so I have experience I can compare.
My productivity has increased a lot since I started using Java because of the free development tools that are available. Netbeans + profiler + Junit make a really nice and powerful package to develop efficient and correct code.
Java performs reasonably well running my simulations. I would say between 80-100% or more of the performance I used to get with compiled languages.
Some people in this thread have said Java can not perform better than compiled languages. Well I can tell you it can for some kind of problems. If you do not believe me, check:
http://shootout.alioth.debian.org/gp4/benchmark.php?test=spectralno…
http://shootout.alioth.debian.org/gp4/benchmark.php?test=nbody&lang…
http://shootout.alioth.debian.org/gp4/benchmark.php?test=takfp&lang…
and others.
Those links also show that Java uses a lot more memory than compiled languages which is completely logic are fine for me. All the nice things that come with Java such as: garbage collector, JIT compiler, etc., have a cost . However, with memory as cheap as today, adding more memory is not an issue (imagine in a couple of years).
Finally, I have been experimenting with the next version of Java (6) and the future looks even better.
These are some numbers I got running some simulations with different versions of the virtual machine.
Time(sec) jdk1.5: client=397 server=327
Time(sec) jdk1.6: client=309 server=298
variation(%) client=22 server =9
Memory(MB) jdk1.5: client=259 server=236
Memory(MB) jdk1.6: client=211 server=207
variation(%) client=19 client=12
Both, server and client versions run faster and use less memory in Java 6. I think it is even more important to notice that there are larger gains in the client version that is the most commonly installed (distributed with the JRE version). It is very nice to get those gains with just changing the virtual machine.
It seems I will graduate a couple of months earlier than I expected!!!
Actually, the overal picture for Java looks extremely bad:
http://shootout.alioth.debian.org/debian/benchmark.php?test=all&lan…
And this is a comparison with Free Pascal, not with GCC where the defeat would be even worse. However, Free Pascal is a more fair comparison since Object Pascal provides largely the same productivity benefits as Java does.
Yes, it can win in some tests, there is no doubt that it is theoretically possible that the JIT-compiler beats a traditional compiler. But you wouldn’t choose Java for speed and not at all for memory usage…
That’s the 1.4 version of Java, there were many performance improvements in 1.5 and many more comming in 1.6. Also observe that Java consistently beat FreePascal in terms of Lines of Code, which doesn’t really matter for small apps but for big apps well time is money . So no I wouldn’t say the overal picture for Java is extremely bad. Oh and there is no true way to put a definitive numerical value on the ability to simply run an application irrespective of the underlying hardware or OS. It’s also very hard to place a value on the scope of the Java libraries. Oh and not to mention the ever increasing number of Java graduates.
Oh and also the client JDK is consistently better than the server JDK : http://shootout.alioth.debian.org/debian/benchmark.php?test=all&lan…
Here is the comparison between the client JDK and freepascal:
http://shootout.alioth.debian.org/debian/benchmark.php?test=all&lan…
Edited 2006-01-15 02:54
Here is the comparison between the client JDK and freepascal:
http://shootout.alioth.debian.org/debian/benchmark.php?test=all&…
Am I missing something or is it still a big defeat for Java?
The lines of code advantage can’t impress me as well, i.e. if you have code like:
if (x==res) { y++; if (acc<256) acc <<= (8-res%8); }
… I would say that costs time due to bad maintainability and time is money as you said…
The code is available to look at, there is nothing like that not in the Java code atleast it is clearly spaced. It would seem to me Java has just plain beaten freepascal in that area.
Java is a nice language but it doesn’t solve every programming problem. I do however think that java will be with us for the next decade or more and its guaranteed to get better.
What I hate about java:
Takes hours to get it up and running my FreeBSD box.
Since I pointed to http://shootout.alioth.debian.org/debian/benchmark.php?test=all&, I think I have to explain some things.
Most of the benchmarks in that page are programs that take few seconds to complete. That is the worst scenario for java. In fact, I find amazing java performance so well in most of those benchmarks. Some reasons why those are bad scenarios for java are:
1) The initialization of the virtual machine takes some time. I have observed that time is almost constant and indepent of the size of your program. Thus, even if Java is able to execute your code faster it has an initial disadvantage. For codes that take some time (most real applications) this is not an issue because there is enough time in order that java can catch up.
In simple words: if I had a 100 mts race with Carl Lewis and he gave me 70 mts of initial advantage I am pretty sure I would win (actually I am not so sure). However, if the race was a 200 mts I am pretty sure he would win.
2) Someone in this thread says that the client is always faster than the server according to those benchmarks. That is only true for codes that take short time, since the server vm has a much higher treshold of invocations before start compiling functions. So for short time codes, the client will give better performance. However, the server has a much more agressive optimization strategy, so for real (longer time) applications it gives much better perfomance as shown in my results.
3) Complaints about how much memory java uses reminds me people that complains about Linux using all the available RAM. In both cases the answer is the same: if that memory is available and is used to improve the performance of your applications, what is the problem with that? That could be a problem if there is not enough memory, but new computers have plenty of it (1GB or more is the norm in new desktops and laptops)
4) I was also confused about java perfomance until I took the time to investigate more. Microbenchmarks can give you a good idea of the performance of compiled languages, but it is very difficult they give you a good estimation of java performance. For example, I wrote some microbenchmarks where java took 12 times more time to complete than optimized Fortran90 or C++ (intel compiler). However, I know that is not true for my simulations. Those benchmarks were so short that the JIT compiler did not have enough time to compile and optimize. When I took the time to write a more accurate benchmark, java took less time that C++ or Fortran90. Real codes are much better benchmarks and java performance is very good in those cases.
Anybody who’s had to walk through endless cross-dependencies in headers causing thousands of compile-time errors because somebody lost track of which #define was needed where, and what the other 117 headers were actually called in this version of some glorious framework, will love the change away from includes and macros and all the problems they cause when programming in the large.
Java is a better language for building huge software systems. If it wasn’t, it wouldn’t be used. No freshman, first-year-of-highschool is asked to build the 1-million line infrastructure of a company. It takes honed skills and years of experience plus knowledge of more than coding to pull that, including about 100 programmers working for a LONG time.
We all know this, and yet we keep complaining about whatever weakness is still in there (and they are getting fewer every upgrade). We all know why Java has a gc and no pointers. It makes sense for most things. Very few other languages have pointers – or at least the means to avoid them, very few do not have a gc, mind you.
For proof of the above, take a look at Lisp, Python, Perl, C#, COBOL, Smalltalk, Ruby, PHP, Javascript, Scheme, D, Oberon, FORTRAN, Ada, BETA, Clean, Haskell, Icon, OCaml, Mozart-Oz, Cecil, Dylan, Eiffel, continue ad. lib. /* Cobol was ACTUALLY used for large projects back when… */
Very few programming languages can be used to write operating systems for that very reason, and those are typically the ones that belong on the other side of the fence: Assembler (a language?), C and C++.
Just as C, and to some extent C++, is not ideal for writing code where hundreds of programmers have to collaborate at different levels of abstraction. Believe me, it’s the tools and the thousands of engineers surrounding Microsoft’s version of C++ that makes it possible to write Windows’ 30+ million lines of code (partly) in C++. And 15 years doing it, working away the bugs.
And, most importantly, it’s abstraction, something which certain other languages, including Java, do much better.
To wear the cliché once again: Use whatever tool is best for the job, or – to modify it a bit, use whatever tool creates the least amount of hassle for you.
And that, my friends, is a language which looks like the ones you’re used to but without the pointers and with a nice gc, preferably easily ported to new platforms so the constant shift to/from x86/Unix/Linux/Vista/Mac OS X/whatnot doesn’t have too large of an impact: Java.
Be happy about the strides that Sun and the others are making as they learn from past mistakes and break new ground.
Says someone who’s NOT a Java buff but neither a narrow-minded fanatic.