Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts 2.0 performance doubt

 
vijay jamadade
Ranch Hand
Posts: 243
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ranchers,

We developed an application using struts 2.0. We have observed that as compared to struts 1.2, Struts 2.0 applications are really slow and has a performance issue.
Please tell me is it true that struts 2.0 has some performance related issues and is unstable. I want to know the experience of you people who have been used this technology so that for upcoming projects we can use it without risk.
 
Nishan Patel
Ranch Hand
Posts: 689
Eclipse IDE Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I don't think that Struts 2.0 is slower than Struts 1.3.

This application speed based on so many other factor.


Some other technology used with your project which is not good combination with struts.

Like you used some extra variable in your class file.Some duplicate repeated code, method , some loops which makes your application slow.

That is depend your coding standards and how to optimize your source code.

Make application optimize like remove some unnecessary query fired at every time.

For Example : if your fill your select box in your jsp list which comes from database and that list is static get that list at application context time and make interceptor for that and call that list every time so no need to fire query and remove trip to every time from database.

So, Planning and standards makes your application better fast performance.

My point of view Struts 2.0 is very good than Struts 1.3 .

You can easily get plug-in, easy to understand, zero configuration, rapid development and many more.

So move to some good feature provide by Struts 2.0 and make your application better.
 
KRISHNA KK
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vijay,

I developed a struts2 web application with websphere it gives a better performance, faster, good functionality as compaire to struts1.2

it's better to used struts2.0
- Removed unce. code from your application.
- Used only recommonded interceptors as need.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See the S2 performance tuning page.

Later versions of S2 are faster because of performance increases, including some in Freemarker and OGNL. Pages with a lot of S2 form tags are usually the culprit in speed-related issues, perhaps somewhat moreso if the OGNL expressions are deeply nested.
 
vijay jamadade
Ranch Hand
Posts: 243
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to ask one more thing that the request for struts 2.0 each time goes through the interceptors and filters.If we are not using the functionality then also it loops through all that things.

In struts.xml we always extend the package declarration with



Is it mean that the request for this namespace is going to have default settings though we dont need that but still as it extends it is doing unnecessary things through extending the struts-default.xml file. If it is so can we avoid it improve the performance
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You'll see a very slight performance increase by removing un-necessary interceptors, but very, very slight--IMO not enough to both with.

Some of the interceptors I generally remove, particularly in production, are the "chain" and "profiling" interceptors. I always remove "chain" because I never chain actions. The "profiling" interceptor can be nice during development, but I've found I almost never use it.

If you're not using the model-driven interceptors they can be safely removed. If you never upload files obviously that can come out as well.

Ultimately, however, the biggest performance hits are on the view side relating to the tag templates (helped by extracting them as detailed on the tuning page) and using the most recent versions as possible of FreeMarker and OGNL.
 
vijay jamadade
Ranch Hand
Posts: 243
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
but how these things can be done, because when i remove the


extends="struts-default" attribute to avoid struts 2.0 default settings it gives me error at the start of tomcat

can you show me some code snippet in struts xml file how you have done the settings for your application
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you read any of the Struts 2 documentation? It covers how to set up your own packages, interceptor stacks, and so on in detail.

Configuration Elements

For an in-depth look at how the struts-default package is configured see this.
 
vijay jamadade
Ranch Hand
Posts: 243
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok thanks friends.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic