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.
Regards, Vijay Jamadade.
( Nothing is Impossible.)
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.
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.
Joined: May 12, 2008
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
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.
Joined: May 12, 2008
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