permaculture playing cards*
The moose likes Performance and the fly likes My Experience With Performance Tuning Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Performance
Bookmark "My Experience With Performance Tuning" Watch "My Experience With Performance Tuning" New topic
Author

My Experience With Performance Tuning

Chetan Parekh
Ranch Hand

Joined: Sep 16, 2004
Posts: 3636
Hello All!!

We are optimizing a java based website and we have achieve significant amount of performance gain by following points.


(1)On the home page, we were proving a facility to download list of various entities ( Customer, Brand Offices, ect). Previously whenever user want to download any list, a database query was firing. All these queries were not high resource intensive, but if you consider the peak hour resource utilization, they become burden. To overcome by this problem, we are written a Servlet that will run automatically whenever App server booted (Our App Server booted every midnight) and will generate .csv files of various lists. User will be downloading .cvs files, rather then firing queries each time.

(2)At some places we are fetching 100+ records from the DB-Tier to App-Tier. As the default Fetch Size is 10 for many drivers, fetching more no of records takes time. We just did ResultSet.setFetchSize(100) and gain lots of performance.

(3)If you are not worried about Thread, use Thread unsafe Collection object, they are really fast.


This is just to give hint, may be all of this not applicable to your project, but I believe some of them will.

If anybody has their own experience, please same the same.

Regards,
Chetan Parekh


My blood is tested +ve for Java.
steve souza
Ranch Hand

Joined: Jun 26, 2002
Posts: 861
Thread safe collections are very fast. In most web apps the performance between the two will not be noticeable.

Here are my performance tips.

1) Always measure performance.

Recently, an app team at my client site was going to switch out their relational database to a high speed warehousing product to improve application performance. This would have entailed rewriting application sql, and writing a bunch of code to get data into the warehouse. We measured their app perfomance (using the JAMon servlet filter) and found the poor performance was due to a couple slow queries. They tuned the queries and saved a lot of work. Without measurements they would still be coding.

2) Java is fast. Most performance problems are IO related (db, network, file)

3) Visit http://www.javaperformancetuning.com


http://www.jamonapi.com/ - a fast, free open source performance tuning api.
JavaRanch Performance FAQ
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: My Experience With Performance Tuning