Java Performance Tuning - contd.

Two standard optimization techniques for reducing I/O overhead are buffering and caching.

Some techniques to improve I/O performance:
Execute I/O in the background.
Avoid executing I/O in loops.

Using System.outor System.err, for logging,purposes can affect performance.
Using any logging framework like log4j, can allieviate this to some extent.
Check Readers are InputStreams performance. Readers may be better.

Use a separate thread to monitor the application.
multithreading issues- race conditions and deadlocks.

Performance tuning is frequently a matter of tradeoffs.

Tuning can be a lengthy process simply because it must be iterative.
Performance problem created (or left uncorrected) in one phase requires roughly five times as much effort to correct in the following development phase.

Performance tuning should be done after the code is functionally correct.
Typically, 80% of the application time is spent in less than 20% of the code.

When designing the application to run activities in parallel, you need to focus on shared resources,especially the time spent using these resources.

Other Books

System Performance Tuning by Mike Loukides (O'Reilly)
Sun Performance and Tuning, by Adrian Cockcroft and Richard Pettit (Prentice Hall).
Windows NT Performance Monitoring, Benchmarking, and Tuning, by Mark T. Edmead and Paul Hinsberg (NewRiders)
Windows NT Applications: Measuring and Optimizing Performance, by Paul Hinsberg(MacMillan Technical Publishing).

Identifying that there is an I/O problem is usually fairly easy. The most basic symptom is that things take longer than expected, while at the same time the CPU is not at all heavily worked.The diskmonitoring utilities will also tell you that there is a lot of work being done to the disks.

Vendor Supplied disk statistics.
average and peak transfer rates
Average seek time,

Cached Filesystems (RAM Disks, tmpfs, cachefs) speeds up reads.
Looking up network addresses is an often overlooked cause of bad network performance.

Lock contention is one of the major reasons for performance problems. There are four types of locking available in Solaris. 1. Mutexes 2. Semaphores 3. Condition Variables and 4. Multiple Readers Single Writer(read-write) locks.



Comments

Popular posts from this blog

How to get started with Vue in under a minute?

aigiri nandini - Brodha V you rock