• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

In the war b/w Struts 2 vs Struts1

 
rajesh vasireddy
Greenhorn
Posts: 18
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All people are saying Struts has performance issues as the FiterDispatcher (Contoller) creates a new action class object for every new request from a web client.
But in struts official website at Struts Offical Website

They said "Struts 2 Action objects are instantiated for each request, so there are no thread-safety issues. (In practice, servlet containers generate many throw-away objects per request, and one more object does not impose a performance penalty or impact garbage collection.) "

The red colored lines say it is not a problem but most of the people say it has problem.

So please real time struts developers in the world who have worked both on Struts 1.x and 2.x please say exact truth to world whether really struts has performance problems due to this aspect.

Thanks in Advance.
 
Orton K Randy
Ranch Hand
Posts: 41
Eclipse IDE Firefox Browser Tomcat Server
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Been using Struts 1.2 before we switched to Struts 2 in my project. From my personal experience, I had NEVER wanted to go back to Struts 1.x. True that Action class is instantiated per request(which you can easily test), and hence thread safe, but they're spot on with the red text in your quote. I don't buy this story of instantiating an Action class for every request degrading performance. At least, we didn't encounter any such performance setbacks.
 
Paul Clapham
Sheriff
Pie
Posts: 20171
25
MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Of course there is no such thing as "exact truth" about whether some programming practice is a "problem" or not. That's like asking for the "exact truth" about whether 125 metres is a "long distance".

In my opinion the sentence you quoted in red letters is correct. If you have an application where the response time requirements are so stringent that you can't afford a millisecond to create an object, then you really shouldn't be using a framework like Struts anyway. But chances are you don't have such an application. Chances are that you don't even have published response time requirements. Chances are that these people talking about "performance issues" haven't even measured any performance measures.
 
rajesh vasireddy
Greenhorn
Posts: 18
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if we increase heap size at server side will there be any change of performance. I am thinking this as if my webapplication got 1000 requests at a time then if i am using struts 2.x then there may be memory problems. So wil der be a change if i inc my heap size.
 
Paul Clapham
Sheriff
Pie
Posts: 20171
25
MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's possible, yes. Depending on what you mean by "performance". Have you measured something and decided it's too small, or too large? Just picking on random things and trying to "fix" them by changing something isn't necessarily going to help your problem, if you even have one.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic