Book description
This book was written with one goal in mind: to provide Java programmers with the expertise needed to build efficient, scalable Java code. The author shares his experience in server-side performance tuning through measured performance assessments, called optimizations. Each optimization discusses techniques to improve the performance and scalability of your code. Every claim is substantiated with hard numbers and an experience-based evaluation. Java™ Performance and Scalability, Volume 1, provides invaluable advice that you will, no doubt, find useful in your coding.
Presented in 48 concise lessons that target the most common and critical performance pitfalls, this book offers a plethora of practical tips and solutions for boosting the performance of your programs. These lessons cover performance-critical areas such as memory management, garbage collection, caching, and multithreading.
Specific lessons include:
Reserving StringBuffer capacity
Avoiding premature object creation
Creating an efficient vector class
Designing caching into your API
The cost of synchronization
Parallel subtasks
JNI efficiency
Varying the server workload and RMI network plumbing
Using ServletOutputStream
Caching JDBC™ connections
In addition to providing hard numbers that quantify the optimizations, the author concludes the book with an application demonstrating the effectiveness of the performance optimizations. The exercise takes a typical program and increases its performance fourfold through a series of steps that tie together the lessons learned throughout the book. He offers both the means and the proof to better coding.
0201704293B04062001
Table of contents
- Copyright
- List of Figures
- Preface
- Introduction
-
1. Java Strings
- Optimization 1: String Concatenation
- Optimization 2: Fight Object Overpopulation
- Optimization 3: String Equality
- Optimization 4: Characters to Bytes and Back
- Optimization 5: StringTokenizer
- Optimization 6: charAt()
- Optimization 7: Prefer charAt() to startsWith()
- Optimization 8: Reserve StringBuffer Capacity
- Key Points
-
2. Pure Overhead
- Optimization 9: Useless Computations
- Optimization 10: Don't Trace Trivial Methods
- Optimization 11: Making Overhead Vanish
- Optimization 12: Premature Object Creation
- Optimization 13: Don't Initialize Twice
- Optimization 14: Do You Really Need to Zero-Out a Buffer?
- Optimization 15: The 80–20 Principle
- Optimization 16: Purge Obsolete Code
- Key Points
-
3. Vectors and Hashtables
- Optimization 17: Vector Add and Remove
- Optimization 18: Vector Capacity
- Optimization 19: Vector Enumeration
- Optimization 20: Efficient Vector Class
- Optimization 21: Using the API Wisely
- Optimization 22: Hashtable Parameters
- Optimization 23: Speed Up hashCode()
- Optimization 24: Speed Up equals()
- Key Points
- 4. Caching
- 5. I/O Streams
- 6. Recycling
-
7. Scalability and Multithreading
- Scalability Basics
- The SMP Architecture
- Amdahl's Law
- Multithreaded and Synchronization Terminology
- The Cost of Synchronization
- Optimization 39: Parallel Subtasks
- Optimization 40: Synchronization False Sharing
- Optimization 41: Lock Fusion
- Optimization 42: Code Motion
- Optimization 43: Share Nothing
- Optimization 44: Partial Sharing
- Optimization 45: Read/Write Locks
- Key Points
- 8. JNI
- 9. RMI
- 10. Servlets
- 11. A Java Web Server
- A. Caching JDBC Connections
- B. Simple Java Web Server
- Bibliography
Product information
- Title: Java™ Performance and Scalability, Volume 1: Server-Side Programming Techniques
- Author(s):
- Release date: June 2000
- Publisher(s): Addison-Wesley Professional
- ISBN: 9780201704297
You might also like
book
Building Scalable and High-Performance Java™ Web Applications Using J2EE™ Technology
provides the concise roadmap Java developers and Web engineers need to build high-performance and scalable enterprise …
book
Android High Performance Programming
Build fast and efficient Android apps that run as reliably as clockwork in a multi-device world …
book
Probabilistic Data Structures for Blockchain-Based Internet of Things Applications
This book covers theory and practical knowledge of Probabilistic data structures (PDS) and Blockchain (BC) concepts. …
video
Scalable Internet Architectures
In this video, we dive deep into traditional web architectures and discuss what makes them go. …