Abstract:
The performance model of Java is comparably complex. The compiler and the runtime system apply complex and ambituous optimization techniques in order to improve your Java application's performance. The flipside of the coin is that it is close to impossible to judge performance issues in Java by any kind of intuition. This makes it difficult to write a meaningful benchmark for comparison of the performance of two algorithms in Java.
In this tutorial we aim to illustrate the "Do's and Don't"s of writing a micro-benchmark in Java. Especially JVMs with HotSpot technology, which are the norm these days, offer countless opportunities for making fatal mistakes. Just to name a typical one: often the code segment whose performance is supposed to be measured falls victim of the so-called "dead code elimination", which means: the compiler optimizes it away. Hence, what is measured is the performance of "nothing". The affected micro-benchmark will still yield a result, but it is meaningless.
In the tutorial we discuss this and several other mistakes, using a case study for illustration and derive guidelines for successful micro-benchmarking in Java.
Audience: Java developers with an interest in the performance of the applications they develop and who need to write a benchmark once and a while.
Abstract:
The latest release of the Java Standard Edition (J2SE 5.0) comes with two major additions, Concurrency Utilities and Generic Types and Methods, plus a number of minor additions to the language.
Concurrency Utilities
A comprehensive library of concurrency utilities has been developed for inclusion in the 1.5 release of J2SE. This library, known as the util.concurrent package, contains thread pools, queues, concurrent collections, special-purpose locks, barriers, and related utilities. The addition to the Java platform is substantial and will change the way we will implement concurrent Java applications. This tutorial gives an overview of the new library.
Generic Types and Methods
The addition of generic types and methods to the Java programming language affect almost every Java programmer because many of the most popular JDK classes are generic in Java 5.0. In this tutorial we take a look into the proposed language feature, how it will help us improve our programs, how it is supposed to be used and where its limitations are. More specifically, we will discuss the additions made to the language itself (generic types and methods), changes to the platform libraries (generic collections) and various exciting details of generics such as the properties of type parameters (their bounds and their scope), generic methods and type parameters inference, and the translation of generics into bytecode.
Minor Additions
The remaining smaller additions to the programming language comprise syntax for enumeration types, an enhanced for-loop, static imports, autoboxing, and varargs.
Audience: Java developers who want to deep their command of the language up-to-date as well as programmers interested
in concurrent programming in Java