Programming Books C Java PHP Python Learn more Browse Programming Books

Sorry, this item is not available in
Image not available for
Image not available

To view this video download Flash Player


Sign in to turn on 1-Click ordering
More Buying Choices
Have one to sell? Sell yours here
Tell the Publisher!
I'd like to read this book on Kindle

Don't have a Kindle? Get your Kindle here, or download a FREE Kindle Reading App.

Java Performance Tuning (2nd Edition) [Paperback]

Jack Shirazi
4.2 out of 5 stars  See all reviews (46 customer reviews)

List Price: $49.99
Price: $34.48 & FREE Shipping on orders over $35. Details
You Save: $15.51 (31%)
o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o
In Stock.
Ships from and sold by Gift-wrap available.
Free Two-Day Shipping for College Students with Amazon Student


Amazon Price New from Used from
Paperback $34.48  
Shop the new
New! Introducing the, a hub for Software Developers and Architects, Networking Administrators, TPMs, and other technology professionals to find highly-rated and highly-relevant career resources. Shop books on programming and big data, or read this week's blog posts by authors and thought-leaders in the tech industry. > Shop now

Book Description

January 28, 2003 0596003773 978-0596003777 Second Edition

Performance has been an important issue for Java developers ever since the first version hit the streets. Over the years, Java performance has improved dramatically, but tuning is essential to get the best results, especially for J2EE applications. You can never have code that runs too fast.

Java Peformance Tuning, 2nd edition provides a comprehensive and indispensable guide to eliminating all types of performance problems. Using many real-life examples to work through the tuning process in detail, JPT shows how tricks such as minimizing object creation and replacing strings with arrays can really pay off in improving your code's performance.

Tuning J2EE applications bears many similarities to tuning J2SE apps, but important and specific considerations apply. For this reason, Java Performance Tuning, Second Edition includes four new chapters: a new chapter on J2EE application tuning in general followed by chapters on tuning JDBC, servlets and JSPs, and EJBs.

Java Performance Tuning offers common-sense advice about what to tune and what to leave alone, emphasizing techniques that provide big performance gains with minimal code restructuring. It gives you crucial guidance that helps you tune without destroying your program's architecture. Blindly changing things in an effort to make a program run faster is a great way to create buggy, unmaintainable code. Java Performance Tuning teaches you to work efficiently and effectively, resulting in code that is robust, maintainable, and fast.

Java Performance Tuning, Second Edition shows you how to:

  • Create a performance plan
  • Glean information about your program's behavior from profiling tools
  • Identify bottlenecks before tuning
  • Minimize the number of objects your program creates, particularly critical for J2EE applications
  • Optimize the use of strings
  • Avoid performance penalties from inefficient code
  • Improve the behavior of loops and switches
  • Optimize I/O behavior
  • Use appropriate algorithms for sorting and other common tasks
  • Use threads effectively
  • Optimize the performance of distributed systems
  • Speed up servlets and JSPs
  • Structure JDBC usage efficiently
  • Use effective design patterns to optimize EJB performance

Covers JDK 1.4

Frequently Bought Together

Java Performance Tuning (2nd Edition) + Java Performance + Java Concurrency in Practice
Price for all three: $117.98

Buy the selected items together

Editorial Reviews

About the Author

Jack Shirazi is an independent consultant. He was an early adopter of Java, and for the last few years has consulted mainly for the financial sector, focusing on Java performance. Before using Java, Jack spent many years tuning Smalltalk applications. Jack's early career involved research in theoretical physics and bioinformatics. Jack has publications in the field of protein structure and is proud to have contributed to some of the core Perl5 modules.

Product Details

  • Paperback: 600 pages
  • Publisher: O'Reilly Media; Second Edition edition (January 28, 2003)
  • Language: English
  • ISBN-10: 0596003773
  • ISBN-13: 978-0596003777
  • Product Dimensions: 1.3 x 6.9 x 9.6 inches
  • Shipping Weight: 2.2 pounds (View shipping rates and policies)
  • Average Customer Review: 4.2 out of 5 stars  See all reviews (46 customer reviews)
  • Amazon Best Sellers Rank: #280,415 in Books (See Top 100 in Books)

More About the Author

Discover books, learn about writers, read author blogs, and more.

Customer Reviews

Most Helpful Customer Reviews
26 of 27 people found the following review helpful
5.0 out of 5 stars Recommended December 6, 2000
The book ranges rather widely, covering a huge number of tuning details. The author seems to know hands-on performance tuning very well, and many of the examples were directly applicable to our own development. There is only one chapter on designing for performance (I would have liked more), but in that chapter he did identify precisely the issues that we encountered in our project. The example of double sorting internationalized text transferred directly to our project and speeded up a crucial area of our presentation. I do recommend this book, but do not expect a design book. This is strongly hands-on performance tuning.
Comment | 
Was this review helpful to you?
18 of 19 people found the following review helpful
This book provides good ideas on tactical optimization for performance gain but could have also covered architectural patterns and process for performance optimization.

This book covers the areas of optimizing compilers, I/O, RAM footprint, small object management and deployment etc.

Next edition may also cover architectural decisions (or patterns) which are costly to reverse later. Also, coverage on processes for performance optimization will be great in next edition. Getting a program to run faster costs money, and thus this business decision should have process ( or guidelines for series of high level actions ) to facilitate the optimization.

Other things, I would like to cover in next edition are

1) How to choose between "speed up the slow things" or "do the slow things less often".

2) How to identify ACTUAL areas of improvement. i.e. Importance of automated run that reasonably simulates the program under its usual conditions. (Example, our test on performance gave excellent results. But European customers rejected the product because we had not simulated ocean hop of packets as 2 databases were in America. Or importance of using a multi-user simulation system to identify real problems i.e. transaction interactions etc).

3) Importance of cohesive, loosely coupled and well factored modules for behaviour-preserving transformations of performance.

4) Importance of measurement before starting optimization.

Anyway, great book.
Comment | 
Was this review helpful to you?
19 of 21 people found the following review helpful
5.0 out of 5 stars Recommended for developers... February 22, 2001
This book is diverse in it's approach to java performance tuning. It is very good at describing common bottlenecks in detail and providing concrete examples of how to write better performing code.
It has good coverage of topics including Object creation, I/O and sorting. It illustrates efficient ways to write loops and switches and provides insight into the performance costs of exceptions and casts. 'Java Performance Tuning' also shows how to implement class specific collection classes among other topics.
It takes a comprehensive look at the java profiling tools available and gives illustrated advantages of applying specific techniques. Performance results are contrasted for the various JVMs (JDK1.2 with and without JIT, JDK1.3, Hotspot 1.0).
'Java Performance Tuning' has improved my programming and will sit on my shelf as an excellent reference I know I can turn to if asked to tune a Java application.
Comment | 
Was this review helpful to you?
18 of 20 people found the following review helpful
5.0 out of 5 stars Criticisms invalid January 16, 2001
I fail to understand the prior critical messages. One said that the author didn't present an accurate description of Reference objects. Well, the description starting on page 108 matches the one I was given by Sun in their performance workshop I attended in Mountain View. So I guess Sun does not know what they are doing in terms of Reference objects :).
Another message claimed that this book was not useful for enterprise applications. To the contrary, I was very impressed with the way he covered the actual process of doing performance analysis, he didn't just present a bunch of individual tips. Many people neglect this in enterprise development - they spend a bunch of time eyeballing the code and trying to do some quick fixes when they really need to set up a harness and do some serious testing.
Comment | 
Was this review helpful to you?
16 of 18 people found the following review helpful
5.0 out of 5 stars Totally worthwhile. December 11, 2000
We used about a dozen of the techniques from the book and our component went from being a real dog to way fast enough. Given what we achieved with the basic techniques, most of the more advanced techniques are unlikely to ever be used by us, but they were interesting and might come in useful one day. The book paid for itself within a day. Definitely useful if you have or anticipate a performance problem.
Comment | 
Was this review helpful to you?
12 of 13 people found the following review helpful
Java Performance Tuning reveals how techniques such as minimizing object creation, replacing strings with arrays, and other techniques can improve code performance. Author and Java expert Jack Shirazi also offers common-sense advice about what to tune and what to leave alone in order to maximize performance while avoiding damaging a program's architecture. Highly recommended as both an instruction manual Java users, Java Performance Tuning is a very well presented, highly recommend, "user friendly" reference that is enhanced with performance tuning checklists enabling developers to make their tuning as comprehensive and effective as possible.
Comment | 
Was this review helpful to you?
10 of 11 people found the following review helpful
5.0 out of 5 stars One of the most useful Java books I own August 29, 2001
This book analyzes what it is that makes many Java programs slow and what can be done to speed them up. Many of the examples exhibit speed increases of 20x-100x! Mr. Shirazi doesn't just talk about optimizing your switch statements so they use the table-lookup version of the bytecode (although that is covered), which is one of the low-level optimizations that will sometimes double the speed of a critical section, but also shows how to implement more profound algorithmic optimizations - the kind that can give order-of-magnitude speedups or better.
Memory management is covered, including excellent coverage of object creation, what the overhead REALLY is, how to reduce it by reusing objects, avoiding primitive wrapper classes, and other optimizations.
There is also suberb advice on algorithms (sorting, searching, data structures), I/O, multithreading (LOTS of fun, as always), character encoding optimization, and the fascinating but complex world of distributed computing.
A good distinction is made between the kinds of optimizations that are simply good coding practices and should be practiced regularly (such as using StringBuffers instead of Strings with the + operator) and those that, while being good for performance, are bad for design and increase maintenance costs. So Mr. Shirazi shows us that we can never know what will be slow until we profile, profile, profile. And the profiling done throughout the book doesn't use expensive commercial products, but simple timing code discussed in the first couple chapters.
Overall, a book I very much enjoyed reading and I highly recommend it.
Comment | 
Was this review helpful to you?
Most Recent Customer Reviews
2.0 out of 5 stars Outdated
Lots new features of JDK should be included.
Too much author's personal idea which are really debatable. Read more
Published on June 3, 2010 by Mike Chang
4.0 out of 5 stars Good book on performance
Pretty good book on covering a majority of the performance issues for Java and how to code for performance.
Published on November 9, 2008 by Brian Hughes
2.0 out of 5 stars Ups and Downs, but generally down
The book covers a wide range of topics with some decent, but out-dated examples. As a collective whole, this writing will get you thinking. Read more
Published on May 18, 2007 by J. Brutto
5.0 out of 5 stars Authoritative and practical, but not for everyone
If you are a core Java developer/architect who does performance tuning on a regular basis this should be part of your library. Read more
Published on January 25, 2007 by Peter Booth
4.0 out of 5 stars A report from the field...
... or "You had a whole SECOND to reply? In MY day..."

First: if you are not a 'hardcore' Java programmer: do not bother with the rest of this review, and do not buy... Read more
Published on November 24, 2005 by Joel Aelwyn
4.0 out of 5 stars Substantial and comprehensive text
This is a substantial and comprehensive text on many aspects of Java Performance characteristics, explaining the effects of Java design and coding practices, and giving... Read more
Published on September 3, 2005 by reviewer at HuNTUG
2.0 out of 5 stars Inaccurate, not worth the time or money
I saw many reviews of this book are full of praise but none of the reviewers actually mention having used it in large enterprise or production-ready systems! Read more
Published on August 4, 2005 by a reader
5.0 out of 5 stars Disagree with an earlier review
I'll state up front I'm a friend of the author, so this is partisan. I completely disagree on a point of fact with the earlier "culturally interresting but professionnally almost... Read more
Published on August 23, 2004 by Brian Johnson
3.0 out of 5 stars a good book, but do you really need it?
Java Performance Tuning would be a good book to have if you have a seriously performance intensive application or for someone who just really dug performance issues. Read more
Published on May 12, 2004 by Amazon Customer
2.0 out of 5 stars culturally interresting but professionnally almost useless
I could resume this book by..."don't code in Java, do it directly in C" remembers me when I was a young C programmer I read a book on performance in C the shortcut... Read more
Published on December 4, 2003
Search Customer Reviews
Search these reviews only

What Other Items Do Customers Buy After Viewing This Item?

Sell a Digital Version of This Book in the Kindle Store

If you are a publisher or author and hold the digital rights to a book, you can sell a digital version of it in our Kindle Store. Learn more


There are no discussions about this product yet.
Be the first to discuss this product with the community.
Start a new discussion
First post:
Prompts for sign-in

Look for Similar Items by Category