Skip to main content

Java Champion Kirk Pepperdine to Speak at Community Corner 2009

Posted by editor on May 13, 2009 at 6:37 AM PDT

Kirk Pepperdine, noted Java performance tuning expert and Java Champion, will be speaking in a Community Corner event, in the booth at JavaOne, on Tuesday, June 2, at 3:00 PM. Kirk will be conversing with Janice J. Heiss of the Sun Developer Network on the topic of (you guessed it) Java performance tuning.

Performance tuning isn't something that every developer thinks they need to know about, and some even consider it a sort of arcane topic area, with vague connections to magic and the waving of wizard's wands. However, in his recent post Performance tuning is about applying localized optimizations (featured in today's Java Today), Kirk tries to dispel this manner of thinking, noting that:

performance tuning is a local optimization and before you apply any advice given by any manual, guide [or] self proclaimed expert, you need to poke your head up, take a look about to see if it will work for you in your current situation.

So, is he saying he can't tell you much about performance tuning? Well, no. What's he's saying is that, with performance tuning, each situation is unique. He can't stand in front of you and tell you how to tune your application for performance; he can only describe to you the types of strategies that may work in certain types of situation.

In other words: there is no magic wand when it comes to performance tuning. Your application is a unique creature, it has its own bottlenecks that are there due to layers of code having been applied probably by different people at different points in time in response to different enhancement and upgrade requirements. There is no way anyone can listen to you ask "How can I make my application run faster?" and say "Do this, this, and this" -- and Voila! your application suddenly runs 10 times faster.

I like this quote a lot:

At an abstract level, a computer system is nothing more than a series of queues. Response times in this system are guided by Little's Law. The applicable part of Little's Law states that throughput is inversely proportional to service time. Placing more load on a system will have the effect of increasing service time which will in turn increase latency. Putting less load on a system should have the opposite effect. But in this case overall response time is a sum of the response times of all the little subsystems. If you decrease the latency in one subsystem you will increase the pressure on downstream subsystems (queues). The net effect on response time will be determined by the difference between the decrease due to the performance improvement and the increase due to the increase in downstream pressure. If the downstream component's performance is close to the tipping point, it could a performance degradation that swamps out the positive benefits gained from tuning part of a system.

[For your reference, here's a description of Little's Law.]

If you've ever done performance tuning on a relatively complex system, you know what Kirk is saying here. If you've worked on a complex system in a situation where different developers were responsible for different components that run sequentially (one receives the output from another and passes its result to a third component), then you've probably experienced "well, I know my component is fast, because it screams in unit testing. Surely the bottleneck is elsewhere..." It's not always that simple. Even a component that is very fast when it is run using a small amount of data (which is how we usually unit test code, right?) can bog down under the stress of high volumes of rapidly arriving data.

Another interesting post, to give you an idea of what it's like to be Kirk Pepperdine on a daily basis (i.e., what kind of stuff does he typically think about as his day proceeds?) is his speculative Non-blocking almost FIFO. Here, he brings up the "problem" of applications running in a "multi-core world":

what does strict FIFO mean in a multi-core world? With more than 1 thread making forward progress, there is in effect a race to the head of the queue which is somewhat non-deterministic. In other words, in complex systems, it's crap shoot as to which thread makes it to the head of any queue prior to any other thread. More over, most people don't really care about first in first out. What they do care about is an ordering of when things get done. I often call this requirement, first in, first done. While that may have made sense in batch/single core, it makes no sense in multi-core. Again, this is a situation where many threads all making simultaneous forward progress are in a race for either the head or tail of the queue.

Multi-core / multithread does indeed change everything.

Then there are issues down at the line-by-line level. Think it's smart to be clever and do in 4 lines what could have been done in 10 straightforward but boring lines of code? Not necessarily. And what about letting yourself get a bit sloppy regarding proper code structure as you race against the onrushing release date? Also not a great idea.

In a 2006 Java Specialists' Newsletter article, Kirk said:

"I have found that violating design principles or writing overly complex code is often the stumbling block to achieving good performance."

In July 2008, Janice Heiss asked Kirk about this, and about writing "dumb" code. Here's part of his response:

While we write code to run on a machine, the primary consumers of code are humans. Dumb code tends to be more readable and hence more understandable. If we can iron out the twists, then we have a better chance of avoiding the dumb mistakes that clever code may hide from us.

Another reason to write dumb code is that most of the complexities are due to some optimization that everyone thinks is needed. In many cases, these optimizations are premature. While I'm all for performance planning, I'm dead set against premature optimizations.

Which brings us to the second question -- how does well-structured code help performance? Most performance problems can only be solved by adding or altering code in the application. I've found that if the code is well structured and loosely coupled, if the classes are cohesive, and the code uses delegation, I can avoid the whack-a-mole problem when I start to change code.

Kirk's live Community Corner 2009 talk with Janice is sure to be an engaging and thought-provoking event. I look forward to seeing you there, at the booth, on Tuesday, June 2, at 3:00 PM.

In our Feature Article,


The latest Java Mobility Podcast is Java Mobility Podcast 78: JSR 290 XML User Interface Markup Language, in which JSR 290 developers Natalia Medvedenko and Petr Panteleyev talk about JSR 290 and the new power it will give Java ME developers.

The latest OpenJDK Podcast is

The latest JavaOne Community Corner Podcast is


In Java Today, we're highlighting Kirk Pepperdine's recent mini-article Performance tuning is about applying localized optimizations: 'I always start my talks with the following disclaimer; "The resemblance of any opinion, recommendation or comment made during this presentation to performance tuning advice is merely coincidental". The slide never fails to both amuse yet cause people to wonder why they decided on my session. Why do I start with this disclaimer?... '

Fabrizio Giudici has looked at many example JavaFX applications, and provides advice on good programming practices in JavaFX: Using Patterns & Clean Code: "We are seeing quite a number of exciting JavaFX demos around, demonstrating the pretty features of the language and the capability of easily integrating cool graphics. But, as a software designer, I can't prevent myself from seeing that in most examples we see bloated code - no good separation of concerns and poor applications of the MVC pattern..."

And Adrian Cole announces jclouds-s3 beta released: "jclouds is an api for concurrent access to cloud services such as Amazon Web Services. Initially we support Amazon Simple Storage Service (Amazon S3). In the future, we will support other amazon web services, as well other service providers..."

In today's Weblogs, Sean Sheedy, who's visiting the UK, posted Attention London/Southampton mobile developers: "Hi, I'm one of the Java ME Executive Committee (EC) members and an Individual JCP member (that is, representing you, and not a big corporation, on the EC.) I would like to hear from other Java ME developers while I'm in the UK this week for EC meetings..."

Marina Sum tells us OpenSSO Fedlet Named Best Innovation by European Identity Conference: "Well-earned honor for the lightweight service-provider implementation of SAML 2.0. As pointed out by Sun's Pat Patterson and Daniel Raskin, OpenSSO's Fedlet won the Best Innovation Award at the recently held European Identity Conference. The Fedlet, in Pat's words, is..."

And Osvaldo Pinali Doederlein announces Full JavaFX comming for Linux and Solaris: "I noticed that bug RT-3308: Media Support for Linux and Solaris was Resolved as Fixed a few days ago. The media support (which is mostly native code) is the major portability trouble in JavaFX, it's the piece that was missing for Linux and Solaris. The bug was also marked as a Release Driver for v1.5..."

This week's Poll asks: "How quickly will JavaFX be adopted as a rich client technology?" Voting is open through Thursday.

This week's Spotlight is Ed Ort's article JavaFX App-O-Rama: Applications From the Community: "Although the JavaFX platform is only a few months old -- its initial full release was in December 2009 -- people are already building some very interesting applications with it. This is a vibrant, creative, and extremely productive community..."

In the Forums, lupanbr asks WS-Security on JAX-WS - Container specific ?: "Hi everyone! I'm currently starting to study about Web services and JAX-WS in general. I've read some about the WS-Security spec and looked up for it's implementation across some technologies and frameworks. For what I've seen, each container/application server (JBoss,Glassfish,Spring...) have their own implementations of the spec (with custom configuration files and annotations for example) , even though they all have support for JAX-WS. Since I'm making some effort not to get specific to a given Application Server (since my organization may change between them) I'm concerned about using a specific implementation from these frameworks/technologies. So my questions are... "

davyp responds in a PhoneME Feature thread Re: No console output: "Hi Vincent, I have indeed implemented some of the mobile media APIs. With phoneME Feature MIDP you can play some wav files, tones, and single track midi files, but only if you open them as resources in your jar file. Unfortunately, some of the code needs to be rewritten for the phoneME Advanced dual stack, and I am having compilation problems when trying to include JSRs at build time. I assume you have been testing audio with different midlets. The different behaviors can be explained by the fact that some audio formats are not supported (like .au or .mp3) and that some midlets may intercept exceptions that are thrown... "

And jkva asks for assistance with [webtier] EL output filtering in JSP: "Hi, I'm working on a JSP application (non-JSF) and I'd like to do some output filtering on every variable that is used in the JSP pages. The reason for this is security, I want to prevent cross site scripting. We're using a home brewn MVC framework which looks a bit like Struts, so I have plenty of options regarding logic placement. The control flow is very simple, all logic is put into Java controllers, which are executed. The controllers return the model back to the page. The framework does this by calling request.setAttribute() for each model variable. So far, so good. The problem is, not every model variable is a simple string. For example, we pass complete domain objects (Client, Transaction, Account) back to the JSP and the JSP then walks over the object graphs..."

Current and upcoming Java

Registered users can submit event listings for the href=""> Events Page using our href="">events submission form.
All submissions go through an editorial review before being posted to the

Archives and Subscriptions: This blog is delivered weekdays as
the Java
Today RSS feed
. Also, once this page is no longer featured as the
front page of it will be
archived along with other past issues in the href=""> Archive.

Kirk Pepperdine, noted Java performance tuning expert and Java Champion, will be speaking in a Community Corner event, in the booth at JavaOne...