<body><script type="text/javascript"> function setAttributeOnload(object, attribute, val) { if(window.addEventListener) { window.addEventListener('load', function(){ object[attribute] = val; }, false); } else { window.attachEvent('onload', function(){ object[attribute] = val; }); } } </script> <div id="navbar-iframe-container"></div> <script type="text/javascript" src="https://apis.google.com/js/platform.js"></script> <script type="text/javascript"> gapi.load("gapi.iframes:gapi.iframes.style.bubble", function() { if (gapi.iframes && gapi.iframes.getContext) { gapi.iframes.getContext().openChild({ url: 'https://www.blogger.com/navbar.g?targetBlogID\x3d8841590\x26blogName\x3dmini+cod\x27s+blog\x26publishMode\x3dPUBLISH_MODE_BLOGSPOT\x26navbarType\x3dBLACK\x26layoutType\x3dCLASSIC\x26searchRoot\x3dhttps://minicod.blogspot.com/search\x26blogLocale\x3den_US\x26v\x3d2\x26homepageUrl\x3dhttp://minicod.blogspot.com/\x26vt\x3d-5922962456000464541', where: document.getElementById("navbar-iframe-container"), id: "navbar-iframe" }); } }); </script>

Sunday, June 05, 2005

Java Performance Issues

Having read the article by Andy Roberts at osnews.com I would like to express my experience to the performance issues of Java. To be honest I do not have exhaustive knowledge of Java therefore my opinions are subjective.

I do agree the fact that JVM is huge, thus requires very long time to load itself into memory and it could be annoying sometimes. Since the start of using firefox, I kept any Java Applets from loading to my browser, just because it took ages to load up, even the simplest applications. Perhaps the only resolution is to permanently keep the JVM in the memory, I guess it’s the case of Java Application Servers?

He reminds the readers that Java is a rich language with new technologies such as garbage collector which C lacks, and the ability of running at multiple platforms without re-compiling. It helps the engineers to concentrate on their development. However, if you consider application performance is a paramount, it seems to me Java isn’t a good choice.

When he compares between C and Java in terms of performance, he refers to some experiments conducted by researchers in the world to clarify Java does not mean “Slow”. Well, it may, or it may not.

The graphical interface used by Java called SWING has been pessimistic among of interface developers including myself. You must have heard of Event Dispatch Thread (EDT) if programming SWING application, it’s a single thread that manages all components within the framework. If you find your SWING widgets doesn’t respond or stop working after a user event (e.g. Mouse Click), you should put your processor-hungry task to a separate thread. I had a similar case in my final year project but I didn’t try it (I was running out of time).

I think it’s difficult to convince people like me to think Java is a “quick” language, but it’s no doubt that it has been one of the most popular language in the market. I was once told by a manager (with a determined voice) from a bank that Java is faster than C++ (for the first time in my life) during an interview and my mind blanked for 10 seconds (at least I guess).

P.S. Google’s Summer of Code looks interesting, however, I’m not a student anymore! : P