Java Platform Performance: Strategies and Tactics / Edition 1

Paperback (Print)
Used and New from Other Sellers
Used and New from Other Sellers
from $1.99
Usually ships in 1-2 business days
(Save 95%)
Other sellers (Paperback)
  • All (24) from $1.99   
  • New (6) from $22.32   
  • Used (18) from $1.99   

Overview

This book addresses a vital issue for all those developing software for the Java™ platform: how to achieve maximum performance and scalability for their applications.

Drawing on the authors' knowledge of the Java programming language and their extensive experience working on performance issues, the book reveals common mistakes and misconceptions concerning the performance characteristics of Java technologies. It offers overall development strategies and concrete, battle-tested techniques to dramatically improve the performance of applications constructed with the Java programming language.

Java™ Platform Performance highlights the importance of integrating performance evaluation into the application development process and discusses measurement techniques. The book then presents practical tactics for enhancing application performance in the areas of I/O, RAM footprint, small object management, algorithms, data structures, Swing, and deployment. Specific topics covered include:

  • Incorporating performance evaluation into the development process
  • Profiling and benchmarking
  • Building scalable, fast Swing GUIs
  • Using high-speed I/O
  • Computing and controlling the RAM footprint
  • Reducing the number of classes
  • Eliminating temporary objects
  • Selecting high-performance algorithms and data structures
  • Using Java native code and applet packaging efficiently
  • Garbage collection
  • Java HotSpot™ technology

With an understanding of the performance issues and specific techniques for reducing overhead discussed in this book, you will have the information you need to enhance theefficiency, speed, and scalability of your software.

Read More Show Less

Editorial Reviews

From Barnes & Noble
The Barnes & Noble Review
Performance is the No.1 obstacle facing the enterprising Java developer. Of course, performance means different things in different environments -- computational performance, RAM Footprint, speed of startup, scalability, user interface responsiveness. Whatever you mean by performance, this book delivers the world's best solutions, straight from Sun's own Java Performance Team.

Performance isn't something that can be bolted on at the end of the development process. This book shows how to integrate performance considerations into Java analysis, design, coding, and testing. Equally important, it presents detailed Java benchmarking and profiling techniques that help you determine where you stand and where you can improve.

Then, the authors take on each key opportunity for Java performance enhancement. You'll learn how to improve I/O using buffered streams, custom buffering, and more effective object serialization techniques. The authors address every component that contributes to bloated application footprints, show how to reduce the number of classes that must be loaded, and optimize code using reflection and other techniques.

You'll find performance-focused coverage of object mutability, algorithms and data structures, working with native code (and understanding the performance costs of JNI), and reducing JAR file sizes and download times. There's also extensive coverage of building more responsive Swing-based user interfaces, including a close look at threading and timing issues, as well as several examples that utilize Swing's JTable component.

Nobody's under more pressure to improve Java's performance than Sun -- and this book brings together the best solutions they've found. If you're a serious Java coder, you shouldn't be without it. (Bill Camarda)

Bill Camarda is a consultant and writer with nearly 20 years' experience in helping technology companies deploy and market advanced software, computing, and networking products and services. His 15 books include Special Edition Using Word 2000 and Upgrading & Fixing Networks For Dummies®, Second Edition.

Booknews
Intended for software developers, this book presents methods for improving the performance and scalability of applications. The authors, a Java engineer and engineering manager, clarify common mistakes and misconceptions about Java performance and provide overall development strategies and techniques for improving applications constructed with Java. Annotation c. Book News, Inc., Portland, OR (booknews.com)
Read More Show Less

Product Details

  • ISBN-13: 9780201709698
  • Publisher: Addison-Wesley
  • Publication date: 6/1/2000
  • Series: Addison-Wesley Java Series
  • Edition description: New Edition
  • Edition number: 1
  • Pages: 256
  • Product dimensions: 7.30 (w) x 9.10 (h) x 0.70 (d)

Meet the Author

Steve Wilson is the Engineering Manager of the Java Performance Team at Sun Microsystems's Java Software unit. There he leads the team that is responsible for performance tuning of the Java™ 2 Standard Edition internals and helps third-party developers improve program code performance. Mr. Wilson previously worked as a member of the Swing team, which developed the Java Foundation Classes toolkit. Prior to joining Sun, he spent several years as an independent consultant specializing in object-oriented technologies.

Jeff Kesselman is an engineer on the Java Performance Team at Sun Microsystems's Java Software unit where he works with various groups to improve Java code performance. Prior to joining Sun, he developed cutting-edge games for several PC and console platforms in the computer game industry.

Read More Show Less

Read an Excerpt

PREFACE:

Author's Note

In 1997, I was hired as a contractor to work on the Java(TM) Foundation Classes (JFC) Swing toolkit (Swing). This was an ambitious endeavor—Swing was slated to become the new standard for developing Graphical User Interfaces (GUIs) with the Java programming language. Prior to the release of Swing, the only GUI toolkit available with the Java platform was the Abstract Window Toolkit (AWT), a fairly primitive GUI toolkit by 1990s standards. While AWT was hobbled by a "lowest common denominator" design, Swing was designed to be a state-of-the-art toolkit. Written entirely in the Java programming language, it offered a powerful Model-View architecture, an advanced widget set, and a revolutionary pluggable look-and-feel (PLAF) system. When JFC was released in mid-1998, it was quickly adopted by thousands of eager developers.

As with any successful new product, along with stories of success came some bitter complaints. Some developers complained about architectural and philosophical issues. Others complained about bugs or the lack of a particular feature. However, the complaints I personally found most troubling were that programs written with Swing were slow.

I convinced my manager to let me spend a week looking into Swing's performance issues, downloaded a trial copy of a profiling package, and started poking at different parts of the toolkit.

It turned out that there were several areas where performance improvements could be made relatively easily. At the end of the week, I wrote a report on my findings and sent it to the rest of the Swing engineering team. Other members of the team got caught up in thespirit of performance tuning and began doing their own analyses. Over the next few months, I spent more and more of my time working on analysis and tuning and the Swing team made numerous performance enhancements. Many of the techniques described in this book are based on the knowledge gained while we were tuning Swing.

In late 1998, we shipped a new version of Swing that was more than twice as fast for typical tasks than the previous release. However, while many developers were pleased with the improvements, we were troubled to see that we still received numerous complaints about performance. Clearly the problem was more complex than we first thought.

I joined the performance team in Sun's Java Software unit in late 1998 and worrying about performance issues became my full-time job. In an effort to better understand the performance issues we and our developers face, I spend a lot of time talking with developers who are working on serious, real-world Java technology-based systems. Developers sometimes point out areas where changes in the libraries or VM could improve the performance of their programs. Part of my group's charter is to help make sure those changes, when appropriate, make their way into the runtime environment.

When working with developers, we also often find areas where changes to their program code can improve performance. We've found that there are a number of common mistakes and misconceptions about the performance characteristics of Java technologies and even about performance tuning in general.

The goal of this book is to share what we've learned about performance tuning Java technology-based systems with a wide audience. We hope that it will prove to be a valuable reference for you.

Steve Wilson
Sun Microsystems

About This Book

The information in this book will help you write high-performance software for the Java platform. It presents both high-level strategies for incorporating performance tuning into your software development process and code-level performance tuning tactics.

The two parts of the book approach performance tuning from different perspectives, providing a holistic view of the performance tuning process.

  • Part I: Strategies provides a high-level overview of the performance tuning process. It focuses on general strategies that you can incorporate into the development process to improve the performance of Java technology-based systems.
  • Part II: Tactics focuses on specific techniques for improving performance once you've figured out where the hot spots and bottlenecks are.
The higher-level information in the Strategies part is intended for a broad audience, including software engineers, engineering managers, technical leads, and quality assurance specialists involved in the development of Java technology-based solutions. The information in the Tactics part is geared toward intermediate to advanced developers familiar with the Java programming language who are looking for concrete coding techniques they can use to speed up their software.

The Strategies chapters are best read as a single piece, but the Tactics part does not need to be read linearly—you can go directly to whatever topic interests you most.

The two appendices at the end of the book provide information about garbage collection and the HotSpot(TM) virtual machine (VM) and how they can impact performance.

Performance Measurements

Unless otherwise noted, all performance measurements described in this book were run on a pre-release build of the Java 2 Standard Edition (J2SE) v. 1.3 using the HotSpot Client VM on the Microsoft Windows operating system.

Specific performance results are only representative of the configuration on which they are run. Factors such as the CPU, hard disk, operating system, and Java runtime environment (JRE) can all impact performance—keep in mind that the same benchmarks run under different configurations might yield substantially different results.

Code Samples

Complete code for the snippets, sample programs, utilities, and benchmarks used in this book is available online at ...

Read More Show Less

Table of Contents



Preface.


Introduction.

I: STRATEGIES.

1. What Is Performance?

Computational Performance.

RAM Footprint.

Startup Time.

Scalability.

Perceived Performance.

2. The Performance Process.

Developing a Performance Process.

References on Object-Oriented Design.

3. Measurement Is Everything.

Benchmarking.

Profiling.

Dealing with Flat Profiles.

II: TACTICS.

4. I/O Performance.

Basic I/O.

Serialization.

5. RAM Footprint.

Computing RAM Footprint.

What Contributes to Footprint?

Class Loading.

6. Controlling Class Loading.

Eager Class Loading.

Reducing the Number of Classes.

Running Multiple Programs.

7. Object Mutability: Strings and Other Things.

Lots of Little Objects.

Handling String Objects.

Mutable Objects in AWT and Swing.

Other Mutable Object Tactics.

Mutable Object Case Study.

Small Objects and the Modern JVM.

Array Mutability.

8. Algorithms and Data Structures.

Selecting Algorithms.

Using Recursive Algorithms.

Beyond Simple Algorithms.

Selecting Data Structures.

Collections Example.

References on Algorithms and Data Structures.

9. Using Native Code.

Native Graphics Example.

Examining JNI Costs.

Native Code Case Studies.

10. Swing Models and Renderers.

Swing's Component Architecture.

Scalable Components.

11. Writing Responsive User Interfaces with Swing.

Guidelines for Responsive GUIs.

Using Threads in Swing Programs.

Using Timers in Swing Applications.

Responsive Applications Use Threads.

Example: Searching the Web.

12. Deployment.

Compiler Options.

JAR Files.

Packaging Utilities.

Dynamic Downloading.

Appendices.

A. The Truth About Garbage Collection.

Why Should You Care About Garbage Collection?

The Guarantees of GC.

The Object Lifecycle.

Reference Objects.

References on Garbage Collection.

B. The Java HotSpot Virtual Machine.

HotSpot Architecture.

Runtime Features.

HotSpot Server Compiler.

X Flags.

XX Flags.

References.

Index 221. 0201709694T04062001.

Read More Show Less

Preface

PREFACE:

Author's Note

In 1997, I was hired as a contractor to work on the Java(TM) Foundation Classes (JFC) Swing toolkit (Swing). This was an ambitious endeavor—Swing was slated to become the new standard for developing Graphical User Interfaces (GUIs) with the Java programming language. Prior to the release of Swing, the only GUI toolkit available with the Java platform was the Abstract Window Toolkit (AWT), a fairly primitive GUI toolkit by 1990s standards. While AWT was hobbled by a "lowest common denominator" design, Swing was designed to be a state-of-the-art toolkit. Written entirely in the Java programming language, it offered a powerful Model-View architecture, an advanced widget set, and a revolutionary pluggable look-and-feel (PLAF) system. When JFC was released in mid-1998, it was quickly adopted by thousands of eager developers.

As with any successful new product, along with stories of success came some bitter complaints. Some developers complained about architectural and philosophical issues. Others complained about bugs or the lack of a particular feature. However, the complaints I personally found most troubling were that programs written with Swing were slow.

I convinced my manager to let me spend a week looking into Swing's performance issues, downloaded a trial copy of a profiling package, and started poking at different parts of the toolkit.

It turned out that there were several areas where performance improvements could be made relatively easily. At the end of the week, I wrote a report on my findings and sent it to the rest of the Swing engineering team. Other members of the team got caught up inthespirit of performance tuning and began doing their own analyses. Over the next few months, I spent more and more of my time working on analysis and tuning and the Swing team made numerous performance enhancements. Many of the techniques described in this book are based on the knowledge gained while we were tuning Swing.

In late 1998, we shipped a new version of Swing that was more than twice as fast for typical tasks than the previous release. However, while many developers were pleased with the improvements, we were troubled to see that we still received numerous complaints about performance. Clearly the problem was more complex than we first thought.

I joined the performance team in Sun's Java Software unit in late 1998 and worrying about performance issues became my full-time job. In an effort to better understand the performance issues we and our developers face, I spend a lot of time talking with developers who are working on serious, real-world Java technology-based systems. Developers sometimes point out areas where changes in the libraries or VM could improve the performance of their programs. Part of my group's charter is to help make sure those changes, when appropriate, make their way into the runtime environment.

When working with developers, we also often find areas where changes to their program code can improve performance. We've found that there are a number of common mistakes and misconceptions about the performance characteristics of Java technologies and even about performance tuning in general.

The goal of this book is to share what we've learned about performance tuning Java technology-based systems with a wide audience. We hope that it will prove to be a valuable reference for you.

Steve Wilson
Sun Microsystems

About This Book

The information in this book will help you write high-performance software for the Java platform. It presents both high-level strategies for incorporating performance tuning into your software development process and code-level performance tuning tactics.

The two parts of the book approach performance tuning from different perspectives, providing a holistic view of the performance tuning process.

  • Part I: Strategies provides a high-level overview of the performance tuning process. It focuses on general strategies that you can incorporate into the development process to improve the performance of Java technology-based systems.
  • Part II: Tactics focuses on specific techniques for improving performance once you've figured out where the hot spots and bottlenecks are.
The higher-level information in the Strategies part is intended for a broad audience, including software engineers, engineering managers, technical leads, and quality assurance specialists involved in the development of Java technology-based solutions. The information in the Tactics part is geared toward intermediate to advanced developers familiar with the Java programming language who are looking for concrete coding techniques they can use to speed up their software.

The Strategies chapters are best read as a single piece, but the Tactics part does not need to be read linearly—you can go directly to whatever topic interests you most.

The two appendices at the end of the book provide information about garbage collection and the HotSpot(TM) virtual machine (VM) and how they can impact performance.

Performance Measurements

Unless otherwise noted, all performance measurements described in this book were run on a pre-release build of the Java 2 Standard Edition (J2SE) v. 1.3 using the HotSpot Client VM on the Microsoft Windows operating system.

Specific performance results are only representative of the configuration on which they are run. Factors such as the CPU, hard disk, operating system, and Java runtime environment (JRE) can all impact performance—keep in mind that the same benchmarks run under different configurations might yield substantially different results.

Code Samples

Complete code for the snippets, sample programs, utilities, and benchmarks used in this book is available online at ...

Read More Show Less

Introduction

Since the Java platform was introduced in 1995 it has become highly popular among both programmers and the companies they work for because it facilitates the rapid development and deployment of new software. From the start, however, Java technology has been dogged with complaints about its speed. A recent search of the USENET group comp.lang.java.programmer resulted in nearly 3,000 articles that contained the words "Java" and "slow." Clearly, performance is an area of concern for many developers.

In the past few years, there have been numerous technological advances that have improved the performance of the Java platform. Just-in-time (JIT) compilers and advanced runtime systems, such as Sun's Java HotSpot Virtual Machine, have significantly improved performance. In addition, as Moore's Law dictates, computers continue to get more powerful every year. Today's average PC is an order of magnitude faster than the average PC at the time Java technology was first introduced. Despite these advances, complaints about the speed of Java technology-based programs persist.

When average hardware performance continues to get faster, and the core runtime technology continues to improve, why do so many developers continue to have performance issues? The answer turns out to be somewhat obvious. The software being developed for the Java platform today is much more complex than it was just a year or two ago. Developers are continuing to push the envelope--each time the tools improve, the scope and complexity of the applications being built with them increases. In short, the technology is fulfilling the promise that it's not just for "Dancing Duke" applets anymore.

Powerful Javatechnology-based enterprise systems are being deployed in situations where millions of dollars are riding on the system's success. Independent software vendors (ISVs) are replacing and trying to compete with solutions written with more traditional languages like C++.

Not only do today's Java applications go far beyond making Duke dance, these large-scale, mission-critical software solutions are more complex than anything many Java programmers have written in the past. As they continue to push the limits of the technology, developers are also being asked to solve increasingly difficult problems that push the limits of their experience.

Developing high-performance software in any language is not a trivial task. In addition to a thorough understanding of the language and libraries you're using, you need to know how to effectively fit performance tuning into your overall development process.

This book presents strategies and tactics you can use to make performance tuning a part your software development process and effectively evaluate and optimize the performance of your software.

Read More Show Less

Customer Reviews

Be the first to write a review
( 0 )
Rating Distribution

5 Star

(0)

4 Star

(0)

3 Star

(0)

2 Star

(0)

1 Star

(0)

Your Rating:

Your Name: Create a Pen Name or

Barnes & Noble.com Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & Noble.com that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & Noble.com does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at BN.com or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation

Reminder:

  • - By submitting a review, you grant to Barnes & Noble.com and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Noble.com Terms of Use.
  • - Barnes & Noble.com reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & Noble.com also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on BN.com. It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

 
Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously

    If you find inappropriate content, please report it to Barnes & Noble
    Why is this product inappropriate?
    Comments (optional)