• Post Reply Bookmark Topic Watch Topic
  • New Topic

Servlet Performance and Optimization Hints  RSS feed

 
sanj duke
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Can anyone give any general advice for fine tuning and increasing the performance of servlets so that they run faster and better? i.e. do's and don'ts
Many Thanks
 
DC Dalton
Ranch Hand
Posts: 287
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
a couple of do's & dont's I live by are as follows:
Don't:
1. Load your code up with HTML or other code...Period
2. If a method is more than a screenfull (You have to scroll) it probably needs to be in a class file by itself.
3. If a servlet is more than, let's say 100 lines of code it needs to be broken out into seperate objects.
4. Get as much of your db connection code OUT of a servlet as possible.....create an object for this or if you are using a servlet container that supports it (like resin) let IT handle your connection &/or pooling
Do's:
1. Create interfaces with string constants for #1 above & implement the interface where needed.
2. Keep to the standards of OOP as much as possible, I have found it to increase performance dramatically!
That's all I can think of at the moment
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Look here: http://www-1.ibm.com/support/manager.wss?rs=180&rt=0&org=SW&doc=7000615
Even though it says "WebSphere" 90% of the tuning hints are generic for any J2EE application server.
Kyle
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!