ISBN-10:
0201704293
ISBN-13:
9780201704297
Pub. Date:
06/05/2000
Publisher:
Pearson Education
Java Performance and Scalability, Volume 1: Server-Side Programming Techniques / Edition 1

Java Performance and Scalability, Volume 1: Server-Side Programming Techniques / Edition 1

by Dov Bulka

Paperback

Current price is , Original price is $34.95. You
Select a Purchase Option
  • purchase options

Product Details

ISBN-13: 9780201704297
Publisher: Pearson Education
Publication date: 06/05/2000
Series: Java Series
Pages: 320
Product dimensions: 7.40(w) x 9.20(h) x 0.67(d)

About the Author


Dov Bulka has spent fifteen years in the trenches of software development delivering large-scale software products to market. He was the performance architect of the IBM Domino-Go Web server that has powered some of the biggest Web sites ever hosted on the Internet, including that of the 1996 Atlanta Olympics. He received his Ph.D. in computer science from Duke University and recently co-authored Efficient C++: Performance Programming Techniques (Addison-Wesley, 2000).

Read an Excerpt

PREFACE:

Performance has been one of the dominant concerns hovering around Java from its infancy. Regardless of an order of magnitude speedup resulting from just-in-time (JIT) compilers, HotSpot, and other advances in JVM technology, the performance issue is still a legitimate concern. The reality facing Java programmers is that it is very easy to write slow Java programs. Java is a performance mine field and expert guidance is a must.

Given the importance of performance to Java developers, it is somewhat surprising that no book has been dedicated to this important topic. Almost any other Java-related issue has had multiple books dedicated to it--RMI, JNI, JDBC, threads, networking, and the list goes on. Conspicuously absent has been Java performance. It has been mentioned in passing by many authors but, to my knowledge, rarely has there been more than a chapter discussing it. This book is aiming to fill that gaping hole. It is entirely focused on Java performance issues from start to finish.

This book is written for Java programmers by a Java programmer. This is an important fact. It is very likely that the Java performance issues that I have dealt with in my code will surface in your code as well. The Java optimization techniques that you will find here will significantly elevate the performance and scalability of your Java programs.

There's plenty of material to cover. Let's get started.



0201704293P04062001

Table of Contents

List of Figures
xi
Preface xv
Introduction xvii
Java Strings
1(32)
String Concatenation
1(5)
Fight Object Overpopulation
6(5)
String Equality
11(3)
Characters to Bytes and Back
14(4)
StringTokenizer
18(5)
charAt()
23(5)
Prefar charAt() to startsWith()
28(2)
Reserve StringBuffer Capacity
30(1)
Key Points
31(2)
Pure Overhead
33(20)
Useless Computations
33(5)
Don't Trace Trivial Methods
38(1)
Making Overhead Vanish
39(1)
Premature Object Creation
40(2)
Don't Initialize Twice
42(2)
Do You Really Need to Zero-Out a Buffer?
44(1)
The 80--20 Principle
45(4)
Purge Obsolete Code
49(1)
Key Points
50(3)
Vectors and Hashtables
53(28)
Vector Add and Remove
53(2)
Vector Capacity
55(2)
Vector Enumeration
57(3)
Efficient Vector Class
60(7)
Using the API Wisely
67(3)
Hashtable Parameters
70(2)
Speed Up hashCode()
72(5)
Speed Up equals()
77(1)
Key Points
78(3)
Caching
81(16)
Cache File Contents
82(2)
Design Caching into Your API
84(1)
Precompute
85(3)
Relax Granularity
88(4)
Inheritance
92(2)
Key Points
94(3)
I/O Streams
97(22)
Example I/O Code
97(3)
Output Buffering
100(2)
Don't Flush Prematurely
102(3)
Prefer Byte Stream to Unicod
105(2)
Input Buffering
107(2)
Byte-to-Char Conversions
109(1)
Binary I/O
110(7)
Key Points
117(2)
Recycling
119(8)
Object Recycling
120(2)
Object Pools
122(3)
Last In, First Out
125(1)
Key Points
126(1)
Scalability and Multithreading
127(34)
Scalability Basics
128(2)
The SMP Architecture
130(2)
Amdahl's Law
132(1)
Multithreaded and Synchronization Terminology
133(3)
The Cost of Synchronization
136(6)
Paralled Subtasks
142(2)
Synchronization False Sharing
144(4)
Lock Fusion
148(4)
Code Motion
152(3)
Share Nothing
155(1)
Partial Sharing
156(2)
Read/Write Locks
158(1)
Key Points
159(2)
JNI
161(8)
JNI Surprise
161(2)
JNI to the Rescue
163(2)
Preface System.arraycopy()
165(2)
Key Points
167(2)
RMI
169(16)
The RMI Network Plumbing
169(5)
Varying the Server Workload
174(7)
RMI Server on Remote Machine
181(1)
Serializing Heavyweight Objects
182(2)
Key Points
184(1)
Servlets
185(26)
Servlets Using PrintWriter
186(3)
Servlets Using ServletOutputStream
189(2)
Precomputing Message Bytes
191(2)
Pumping More Data
193(3)
PingServlet---A Performance Upper Bound
196(1)
Extending PingServlet
197(1)
Session State
198(2)
PingJdbc
200(3)
Caching JDBC Connections
203(2)
JSP---Java Server Pages
205(1)
RMI
206(3)
Key Points
209(2)
A Java Web Server
211(28)
Version 1: The Original Server
211(4)
Version 2
215(4)
Version 3
219(3)
Version 4
222(7)
Version 5
229(5)
Version 6
234(3)
Key Point
237(2)
A Caching JDBC Connections 239(26)
CacheDriver.java
239(7)
CacheConnection.java
246(5)
CacheStatement.java
251(4)
CacheCallableStatement.java
255(4)
CachePreparedStatement.java
259(5)
CacheDriver.properties
264(1)
B Simple Java Web Server 265(12)
Sever.java
265(9)
FileInfo.java
274(1)
UrlCache.java
275(1)
LazyDate.java
275(1)
MyGetBytes.java
276(1)
server.properties
276(1)
Bibliography 277(4)
Index 281

Preface

Performance has been one of the dominant concerns hovering around Java from its infancy. Regardless of an order of magnitude speedup resulting from just-in-time (JIT) compilers, HotSpot, and other advances in JVM technology, the performance issue is still a legitimate concern. The reality facing Java programmers is that it is very easy to write slow Java programs. Java is a performance mine field and expert guidance is a must.

Given the importance of performance to Java developers, it is somewhat surprising that no book has been dedicated to this important topic. Almost any other Java-related issue has had multiple books dedicated to it—RMI, JNI, JDBC, threads, networking, and the list goes on. Conspicuously absent has been Java performance. It has been mentioned in passing by many authors but, to my knowledge, rarely has there been more than a chapter discussing it. This book is aiming to fill that gaping hole. It is entirely focused on Java performance issues from start to finish.

This book is written for Java programmers by a Java programmer. This is an important fact. It is very likely that the Java performance issues that I have dealt with in my code will surface in your code as well. The Java optimization techniques that you will find here will significantly elevate the performance and scalability of your Java programs.

There's plenty of material to cover. Let's get started.



Customer Reviews

Most Helpful Customer Reviews

See All Customer Reviews