This concise book offers plenty of concrete suggestions for improving real-world programs, but it also helps you think about performance as you design and test Java software. The authors first look at what "performance" really means. Beyond raw computational speed, this term can mean reducing RAM footprint, creating more responsive interfaces, and adding better scalability to programs so that they can handle more users and data.
A strength of this title is that the authors share their expertise, garnered from optimizing the Swing classes for Sun. (The tips for creating custom models and renderers in Swing will help your tables and other controls work with large datasets efficiently.) This text shows you how to benchmark and profile Java code and where to look for problem hot spots--and, once these are solved, where to go next for even better performance. You learn how to reduce object creation and class loading, which can allow your programs to load faster and consume less memory.
Also notable here is a solution for letting multiple Java programs share a single JVM for reduced memory overhead. The authors do a good job of dismantling the notion that using the Java Native Interface (JNI) is a quick fix for better performance. (The benchmarked code suggests that in almost every case native code is likely to be slower.) They also show how memory leaks still can exist in Java, and how to find them. The book closes with a guide to Java garbage collection and the latest on Sun's HotSpot Virtual Machine.
If anything, this book will convince you that good performance in Java isn't accidental; it takes planning, expertise, and plenty of testing. Also, it will get you thinking about performance in new ways with excellent strategies and tips that can help you write faster and more efficient Java code. --Richard Dragan
Topics covered:
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.We especially need to thank Larry, who provided much needed management support throughout the project. Lisa Friendly and Tim Lindholm, editors of the Java Series, patiently guided two first-time authors through the process of making this book a reality. Mike Hendrickson and Julie DiNicola from Addison-Wesley were immensely helpful throughout the entire process.
Deborah Adair of The Design Cage served as part editor, part graphic designer, and part writing coach. We couldn't have finished the project without her help.
Hans Muller, the technical lead for Project Swing and the foremost expert on Swing's threading model, provided the material for Chapter 11, Writing Responsive User Interfaces with Swing. He spent many nights and weekends working on this chapter so the rest of us could better understand how to use threads in Swing programs.
Alan Sommerer contributed to the outline and organization of early drafts, ensuring that key concepts were not missed.
David Wilson and Doris Chen began writing a two-day training course on performance tuning about the same time we started working on this book. We exchanged many ideas with them and believe both the course and the book benefited.
Over the past year, Agnes Jacob introduced us to many developers who had performance-related issues. These experiences were invaluable in deciding what information to include in this book.
Many people provided a tremendous amount of input to the book by reviewing early drafts or providing important technical tidbits: Eric Armstrong, Tom Ball, Clifford Crick, Mark Davidson, Joshua Engel, Peter Haggar, Howard Harkness, Cay Horstmann, Peter Kessler, Gary Little, Mike Martak, Mike McCloskey, Dave Mendenhall, Philip Milne, Srdjan Mitrovic, Bill Pataky, Nancy Schorr, and David Stoutamire.
0201709694P04062001
Product Details
Would you like to update product info or give feedback on images?
|
|
Share your thoughts with other customers:
|
||||||||||||||||||||||
|
Most Helpful Customer Reviews
27 of 30 people found the following review helpful:
2.0 out of 5 stars
Shallow coverage with some redeeming utility,
By Bob Carpenter (New York, NY) - See all my reviews
This review is from: Java™ Platform Performance: Strategies and Tactics (Paperback)
The table of contents is deceptive, because all of the important optimization topics are covered, including the Java-specific ones. The problem is, most of these topics are not covered in any depth beyond a simple introduction. I like terse books and believe most books about computers these days are way too fat; my hats are off to Addison Wesley for controlling that tendency with well edited books in this series. This book is thin at 230 pages, but unfortunately, a lot of that is filler of the "let me tell you what I'm going to tell you, tell you, and then tell you what I told you variety. The advice is generally sound, such as "use a profiler to decide what to optimize", but all too often the advice stops there. One learns that linked lists are fast for deletes and array lists are fast for random access. But what if neither has the performance characteristics you need? I would recommend Jon Bentley's "Programming Pearls" for someone who really wants to get a feel for optimization through a number of tight case studies. The examples may be C, but they're insightful and more applicable to the problems you're likely to face than the ones encountered when writing the Swing or Collections classes themselves. Then go out and use a serious optimizer like Quantify, which is essentially what the authors of this book suggest. At that point, you'll wonder why the authors stopped their review of Collections with Sun's built-in implementations. The code for running mulitple programs and controlling class loading in Chapter 6, though I have not tried it, is interesting and something I'd not seen elsewhere. Other diversions, such as timers and threading in Swing are covered elsewhere. What would have been helpful is a detailed look at debugging threading performance, say through object, resource or thread pooling (an idea dismissed earlier for "small objects"). One glaring omission is a serious micro-benchmarking of basic operations. I found the comparison of speed when using final vs. non-final classes or methods to be startling in practice, and numbers here would help. Similarly, access times for hash tables vs. arrays, simple object construction times, floating point vs. integer arithmetic times, object variable vs. local variable access, etc. There are some wonderful micro-benchmark applets on the web with this functionality. What you'll learn is that up-casting takes forever, so any use of built-in collections/iterators for performance-critical operations will do you in. I found the constant sales pitch for the Sun HotSpot (TM) Virtual Machine a bit tiring. It concludes with a recapitulation of the marketing materials in Appendix B. It is alternately described as "highly optimized", "state-of-the-art", having a "superior memory allocator", "ultra-fast", having "excellent multiprocessor performance characteristics", having "agressive inlining", having "excellent paging", etc. etc. The appendix devoted to HotSpot (TM) is particularly noteworty for its omission of any profiling information!
8 of 8 people found the following review helpful:
4.0 out of 5 stars
Great start, straight to the point,
By A Customer
This review is from: Java™ Platform Performance: Strategies and Tactics (Paperback)
Although this topic could be explored a lot deeper, this is a great book to get started on Java performance. I read it, cover to cover, in a few days on the bus, back and forth to work, and it's changed my approach to coding in Java.The first part on strategies is fundamental and cover concepts on performance. This is a must for anybody who wants to get started on the topic. The second part on tactics goes into details about spesific issues in Java, and because of the GUI / Swing background of the authors, it is mostly focused on topics related to that. If that's what you're working on, this is a 5 star book, but since Java is becoming more and more server focused technology, it's a little bit missing for people like myself who write Servlets and JSPs. Hopefully, there'll soon be a book that discusses performance in J2EE.
17 of 20 people found the following review helpful:
5.0 out of 5 stars
Improve your Java by shedding its myths,
By
This review is from: Java™ Platform Performance: Strategies and Tactics (Paperback)
There are a number of things everybody 'knows' about Java. Bad things such as "It's slow (but can be speeded up by calling native methods)" or good things such as "It doesn't leak memory". Unfortunately, like most things, the truth is more complicated.Wilson and Kesselman have done an excellent job of getting under the bonnet (or hood for those in the US) of Java whilst firmly remaining practical rather than theoretical. I bought the book because we suspected memory leakage problems in one of our applets but couldn't find much information on the subject elsewhere. The net result is that we've had our eyes opened to a number of issues we weren't aware of and have been able to tackle them with informed confidence rather than ill-educated guesswork. A particular bonus is the information on benchmarking. So often we find we develop solutions on the basis of ease of coding rather than performance (not always bad thing). What I've found now is that I have greater confidence in both trying out different solutions and then concrete evidence with which I can justify my decisions to others. Though not for beginners, I would reccommend this book as a good one for expanding your knowledge of how to deliver good, practical, faster and more robust Java. Being able to give sound background information on why you write a piece of code in a particular way is an important step on the way from being a developer to being a key developer.
Share your thoughts with other customers: Create your own review
|
|
Tags Customers Associate with This Product(What's this?)Click on a tag to find related items, discussions, and people.
|
|
This product's forum
Active discussions in related forums
Search Customer Discussions
|
Related forums
|