The i-Technology Media!
Register | Log in
   
 
.NET  ·  AJAX  ·  CLOUD  ·  ECLIPSE  ·  FLEX  ·  OPEN WEB  ·  iPHONE  ·  JAVA  ·  LINUX  ·  OPEN SOURCE  ·  ORACLE  ·  PBDJ  ·  SEARCH  ·  SILVERLIGHT  ·  SOA  ·  VIRTUALIZATION  ·  WEB 2.0  ·  WIRELESS  ·  XML
Comments
Drool, Britannia? Is the UK Failing the Cloud?
By Roger Strukhoff
Richard Davies wrote: The UK has a good crop of technology pioneers in cloud computing - for example ElasticHosts, FlexiScale, Flexiant, OnApp - and also some strong government initiatives such as G-Cloud. We will have to see whether this kind of technical leadership converts into swift mass-market adoption or not.
Jan. 8, 2012 11:38 AM EST
read more & respond »
Cloud Expo on Google News
Did you read today's front page stories & breaking news?

Cloud Expo & Virtualization 2011 West
Keynotes
Oracle
Opening Keynote | An Enterprise Cloud for Business-Critical Applications
Abiquo
Day 2 Keynote | The Enterprise Cloud Tightrope - Balancing for Success
Akamai
Day 3 Keynote | The DNA of an Enterprise Cloud
DIAMOND SPONSOR:
Oracle
Many Clouds, Many Choices'Cloud
PLATINUM PLUS SPONSORS:
Abiquo
Enterprise Cloud Best Practices - Town Hall - Join the discussion…
PLATINUM SPONSORS:
Intel
Progressing Toward the Federated, Automated and Client-Aware Cloud
New Relic
How to build an app with Twitter-like throughput
Rackspace
Computing in the Cloud Era
GOLD SPONSORS:
Gale Technologies
Practical Cloud Migration
IBM
Re-think IT. Re-inventing Business.
Intel/McAfee
Identity Driven Security in the Cloud
PerspecSys
Hackers Hackers Everywhere, Is My Public Cloud That Safe?
Red Hat
Unlock the Value of the Cloud
SHI
Mission Critical Applications and the Cloud - Myth or Reality?
SoftLayer
Not Your Grandpa's Cloud
Terremark
Integrating Enterprise Clouds
VMware
Upgrade to a vCloud
POWER PANELS:
Cloud Expo Silicon Valley: CTO Power Panel
Cloud Expo Silicon Valley: CEO Power Panel
Cloud Expo Silicon Valley: Cloud SuperStars Panel
Cloud Expo Silicon Valley: CloudNOW Panel
Click For 2010 West
Event Webcasts
Cloud Expo & Virtualization 2011 East
DIAMOND SPONSOR:
Dell
Dell & VMware Deliver the Enterprise Hybrid Cloud
PLATINUM PLUS SPONSORS:
Abiquo
Are Financial Services Organizations Risking Security by Avoiding Cloud Computing?
Oracle
From Consolidation to Enterprise Private PaaS
PLATINUM SPONSORS:
Intel
Driving the Transformation to Next Generation Cloud Data Centers
Rackspace
The Inevitability of an Open Cloud
GOLD SPONSORS:
CA Technologies
Follow YOUR path to Cloud Computing
Interxion
Who Keeps the Cloud in the Air?
Microsoft
Patterns for Cloud Computing
PerspecSys
War in the Clouds: Are you ready?
ServiceMesh
The Big Win: Stop Playing Small-Ball with Your Cloud Strategy
Terremark
Evaluating Enterprise Clouds
Xiotech
Cloud Storage: Myths and Realities
POWER PANELS:
Cloud Expo New York: CTO Power Panel
Cloud Expo New York: CEO Power Panel
Cloud Expo New York: CMO Power Panel
Cloud Expo New York: Wrap-Up Power Panel
Click For 2010 West
Event Webcasts
Live Google News by SYS-CON!
Top Three Links You Must Click On


Java SE 6
Performance in J2SE 5.0
What's new and what's faster

By: Osvaldo Pinali Doederlein
Apr. 7, 2005 12:00 AM
  • 1
  • 2
  • next ›
  • last »

If you're a Java developer like me you ask two questions about every major J2SE release. What's new, and what's faster (or slower). Tiger includes a large number of well-publicized, high-profile features like generics, annotations, or the full new API for concurrent programming.

But the adoption of new features usually takes time, and until your J2EE product is updated to the new JRE; your corporate clients' admins let the new JREs pass; large teams get acquainted with new features, or complex systems are carefully redesigned to take advantage of such features. But even in these situations, it's always possible to move to the new J2SE as an optional deployment platform, just for the "free lunch" benefits of better performance or, as in J2SE 5.0, the JVM management features.

My approach here is to look at J2SE 5.0 as an improved runtime for existing apps. I'm sure that all the hard-working people at Sun and the many Tiger JSRs will be mad if developers don't hurry to all those cool new APIs and language features, but using J2SE 5.0 as "just a better runtime" is a good kick-in-the-door to push Tiger - remarkably inside more conservative shops where the rule of "if it ain't broken, don't fix it" drives advanced developers crazy. My personal answer is simple; if it's slow, then it is broken, and if the new JVM is faster, then the old is slow and therefore broken, and so are all my apps! But some facts are needed to substantiate this argument.

While J2SE updates always bring new optimizations and performance enhancements, it's also true that major new versions of any software (remarkably dot-zero ones) are often suspect of being "big bloated new version," and Java's no exception. Before proving that J2SE 5.0 is any faster than 1.4.2, we must first show that it's not slower, obeying the Hippocratic rule "First do no harm." So we'll approach each aspect of Java performance critically, first checking whether Tiger risks making anything worse, and only then looking at the possible gains.

New Features
New APIs are often bigger and more sophisticated than their predecessors (like Swing in Java 2 compared to the old AWT). This is what makes people cry, "Bloat!" (Until they can't live without the new API.) The good thing is that you only bother about the resource requirements of a new API, or about its performance, relative to previous alternatives. On the other hand, any performance advantages won't be collected before the new API is used. In short, existing apps shouldn't be affected, for better or worse, if deployed unchanged with the new runtime.

J2SE 5.0 adds some big new APIs, but they are useful to a narrow audience.

The new instrumentation, management, and debugging/profiler APIs are good for developing or monitoring scenarios. They have a performance impact, but only if active. If you're debugging, profiling, or monitoring a JVM instance via JMX or SNMP, you're obviously going to pay a price, but otherwise you shouldn't notice any difference because these features are available.

The new concurrency API, one of my Tiger favorites, can be used directly by advanced application developers, but most programmers writing business apps will only use this API indirectly once their middleware (like J2EE containers) are updated to exploit the new APIs. The good news is that when it happens, existing applications will benefit from more efficient concurrency (better performance and scalability) without any change.

J2SE 5.0 adds many small APIs, like those for formatting/scanning, but these won't have a significant impact in the footprint or other performance measures of most applications except perhaps in specialized apps that make heavy use of such APIs - e.g., some ETL tool that's rewritten to use java.util.Scanner to parse monster-sized text files.

Unlike the AWT Swing transition, there won't be a rush to port application code to a major new API from Tiger because there are no new APIs that are as broadly appealing. All the new Tiger features that should become "pop hits" are language-level features, even though some of them are supported by new improved APIs.

Generics have no performance (dis)advantages. That's part of the erasure deal; javac uses the generic types to do static validations, then discards these types, so the bytecodes produced are the same as usual (including typecasts). Classes and methods supporting generic parameters will grow a bit because javac will generate extra signature metadata in the .class files. But there's no impact at all on code that only uses generic types, either in the traditional way (e.g., declaring an ArrayList) or with the new generic syntax (e.g., declaring an ArrayList<String>).

Annotations tell a similar story. New metadata can be stored in the .class files, and be available through reflection. If you consider the amount of metadata that's already hacked into J2EE descriptiors, javadoc tags (especially with annotation-like tools such as Xdoclet), and the large number of new JSRs currently in development to define annotations for everything (servlets, EJB, Web Services, JDBC, and so on), it feels like a possible source of lots of space overhead. Fortunately, the Java annotation facility lets these overheads be controlled. The meta-annotation "Retention" ranges from SOURCE (zero overhead) to CLASS (it only makes classfiles bigger) and RUNTIME (annotations are available for reflection inspection, which consumes memory).

Other language enhancements like enhanced for, static import, autoboxing, and enums, have no direct performance impact good or bad. These features are mostly "syntax sugar." Indirectly, however, these features create some opportunities to change your performance. Autoboxing makes it all too easy to work with wrapped primitive values, e.g., to put integers inside collections. New code can use autoboxing carelessly in situations where one could work a bit harder (e.g., using primitive arrays instead of collections). On the other hand, when autoboxing replaces old code that used wrapper classes, the result should be more efficient. Autoboxing doesn't use wrappers' constructors (e.g., new Integer(99)), it uses new factory methods (Integer.valueOf(99)) that return cached objects for the most frequent values (like ints from -128 to +128). (You can also invoke these new methods manually.)

Updated Features
Updated APIs are a gray area. They may impact your performance even if you don't use the new or improved features. Even if you don't use any new methods, footprint and speed can be impacted when the improvements involve architectural changes to the APIs. There are some "suspects" in this category for J2SE 5.0.

The Unicode spec was updated in version 4.0, including characters that don't fit anymore in the 16-bit char type, requiring a pair of values for some extended characters. APIs for Strings, text formatting, and regex had to be updated for full compatibility with this new standard, breaking some assumptions that we thought cast in stone - e.g., String.length() still returns the number of chars in the string, but not necessarily the number of lexicographical units. This is now only assured by the new String.codePointCount() method. If you're a heavy user of core string classes (including the new StringBuilder), don't worry; the existing methods don't do anything to support Unicode 4.0; that's why there are new methods for this. But if you're a heavy user of higher-level text processing APIs, like java.util.regex.Matcher, their performance may have changed even if your app doesn't use the new Unicode characters, because the latter APIs will need to use the newer String methods anyway to be safe just in case the text contains Unicode 4.0 characters.

  • 1
  • 2
  • next ›
  • last »
Published Apr. 7, 2005— Reads 31,840
Copyright © 2005 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
About Osvaldo Pinali Doederlein
Osvaldo holds an MSc in software enginnering and works as technology architect at Visionnaire S/A, developing J2EE technology-based applications.

Add Your Feedback

In order to post a comment you need to be registered and logged in.

Register | Sign-in

Reader Feedback: Page 1 of 1

Subscribe to the World's Most Powerful Newsletters
Subscribe to Our Rss Feeds & Get Your SYS-CON News Live!
Click to Add our RSS Feeds to the Service of Your Choice:
Google Reader or Homepage Add to My Yahoo! Subscribe with Bloglines Subscribe in NewsGator Online
myFeedster Add to My AOL Subscribe in Rojo Add 'Hugg' to Newsburst from CNET News.com Kinja Digest View Additional SYS-CON Feeds
Publish Your Article! Please send it to editorial(at)sys-con.com!

Advertise on this site! Contact advertising(at)sys-con.com! 201 802-3021

SYS-CON Featured Whitepapers

ADS BY GOOGLE

Breaking Java News
Tuesday's Children Transforms Career Guidance Initiatives Into "Career Resource Center"
Shenandoah Valley Rentals in Fisherville, Virginia Adds U-Haul Rentals
Zycus Announces New Addition and Multiple Enhancements to its Full Suite of Procure Performance Solutions
Martin Rental in Lamar, Colorado Adds U-Haul Rentals
Broadway Auto Care & Diagnostic in Garland, Texas Adds U-Haul Rentals
StorageCraft Launches Backup and Disaster Recovery Training and Certification
Acotel Group Creates Acotel Interactive Inc., Dedicated to Web and Mobile Services for the Global Market
Free Webinar "Roadmap to Successful Offshoring"
Nelnet to Announce Fourth Quarter and Year-End Results on Feb. 28; Dividend Approved
Texas-based Organ and Tissue Recovery Agency, LifeGift, Recovers Its First Hand for Transplant

ADVERTISE   |   MAGAZINE SUBSCRIPTIONS   |   FREE BREAKING-NEWSLETTERS!   |   SYS-CON.TV   |   BLOG-N-PLAY!   |   WEBCAST   |   EDUCATION   |   RESEARCH

.NET Developer's Journal - .NETDJ   |   ColdFusion Developer's Journal - CFDJ   |   Eclipse Developer's Journal - EDJ   |   Enterprise Open Source Magazine - EOS
Open Web Developer's Journal - OPENWEB   |   iPhone Developer's Journal - iPHONE   |   Virtualization - Virtualization   |   Java Developer's Journal - JDJ   |   Linux.SYS-CON.com
PowerBuilder Developer's Journal - PBDJ   |   SEO / SEM Journal - SJ   |   SOAWorld Magazine - SOAWM   |   IT Solutions Guide - ITSG   |   Symbian Developer's Journal - SDJ
WebLogic Developer's Journal - WLDJ   |   WebSphere Journal - WJ   |   Wireless Business & Technology - WBT   |   XML-Journal - XMLJ   |   Internet Video - iTV
Flex Developer's Journal - Flex   |   AJAXWorld Magazine - AWM   |   Silverlight Developer's Journal - SLDJ   |   PHP.SYS-CON.com   |   Web 2.0 Journal - WEB2
Apache   |   CMS   |   CRM   |   HP   |   Oracle Journal   |   Perl   |   Python   |   Red Hat   |   Ruby on Rails   |   SAP   |   SaaS

SYS-CON MEDIA:   ABOUT US   |   CONTACT US   |   COMPANY NEWS   |   CAREERS   |   SITE MAP
SYS-CON EVENTS:   |  AJAXWorld Conference & Expo  |  iPhone Developer Summit  |  Cloud Computing Conference & Expo  |  SOA World Conference & Expo  |  Virtualization Conference & Expo
INTERNATIONAL SITES:   India  |  U.K.  |  Canada  |  Germany  |  France  |  Australia  |  Italy  |  Spain  |  Netherlands  |  Brazil  |  Belgium
 Terms of Use & Our Privacy Statement     About Newsfeeds / Video Feeds
Copyright ©1994-2008 SYS-CON Publications, Inc. All Rights Reserved. All marks are trademarks of SYS-CON Media.
Reproduction in whole or in part in any form or medium without express written permission of SYS-CON Publications, Inc. is prohibited.
 
close this window