|
 |
|
 |
 |
Java(TM) Platform Performance: Strategies and Tactics (The Java Series)
|
by Steve Wilson and Jeff Kesselman
Sales Rank: 560352
|
List Price: $39.99
$33.99
At Amazon

|
|
Paperback: 256 pages
Publisher: Prentice Hall PTR June 10, 2000
Language: English
ISBN-10: 0201709694
ISBN-13: 978-0201709698
Product Dimensions:
9.1 x 7.3 x 0.6 inches
Shipping Weight: 14.9 ounces
Product Review
Now that Java is doing more and more in the field, improving its speed and efficiency is crucial for many working developers. Written by two Sun insiders, Java Platform Performance gives the experienced Java programmer plenty of useful strategies and tips for getting the most out of Java code.
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: - Measuring Java performance (computational speed, RAM footprint, startup time, scalability, perceived performance)
- Engineering performance into the software design process
- Benchmarking techniques (micro- and macro-benchmarks)
- Profiling
- Techniques to improve I/O performance
- Reducing RAM footprint (including minimizing object creation and detecting memory leaks)
- Controlling class loading (eager class loading and patterns for reducing the number of classes)
- Running multiple Java programs within the same virtual machine
- Optimizing String objects
- Object mutability and performance
- Choosing the right algorithm and data structure
- The Java Collection classes and arrays compared
- Four patterns for the Java Native Interface (JNI)
- Why native code is often slower
- Swing custom models and renderers for improved performance and scalability
- JDK 1.3 and Swing Timers for more responsive user interfaces
- Deployment and performance hints
- Tutorial on Java garbage collection
- The Java HotSpot Virtual Machine
Book Description
This book addresses a vital issue for all those developing software for the Java(tm) 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(tm) 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(tm) 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 the efficiency, speed, and scalability of your software.
Customer Reviews & Comments
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!
Comment | Permalink |
(Report this)
|
Java(TM) Platform Performance: Strategies and Tactics (The Java Series)
List Price: $39.99
Available from Amazon
Price: $33.99

| |
|
|
|
|