Meaningless Drivel is fun!*
The moose likes Struts and the fly likes struts performance Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "struts performance" Watch "struts performance" New topic
Author

struts performance

sarah Marsh
Ranch Hand

Joined: Mar 06, 2001
Posts: 282
Hi,

If the application is heavy data load and nearly real time presetation, I heard that it's better to write regular Servlets instead of using struts.
Is this true?

Thanks in advance!
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Well, everything is relative...

Obviously you can get better performance by writing as much as possible from scratch instead of using a more generic framework like Struts. It's the same reason why you can get better performance by writing CPU intensive code in assembler than in C/C++ ...

What kind of application you're talking about? I believe it would be worth exploring whether you could use custom servlets for just the performance critical services and rely on an existing framework like Struts for the bulk of the work.


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
sarah Marsh
Ranch Hand

Joined: Mar 06, 2001
Posts: 282
Thank you. It's online application for supply chain. Mixing custom servlet with struts is the good coding style?
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Originally posted by sarah Marsh:
It's online application for supply chain. Mixing custom servlet with struts is the good coding style?
The reason why I asked about the type of application was to get an idea whether you're dealing with form submissions and navigation or system-to-system communication using XML messages, for example. The latter case would present no need for a web framework like Struts.

I wouldn't exactly call mixing servlets with Struts a "good" coding style, but if you make the decision to mix the two based on solid arguments (like, "it can be done without adding unnecessary complexity elsewhere in the codebase") then it should be a pragmatic coding style.

In fact, I'd love to hear others' opinions on this.
sarah Marsh
Ranch Hand

Joined: Mar 06, 2001
Posts: 282
We're dealing with form submissions and navigation, data are in the database. We have system-to-system communication using XML messages, the data in XML also load into the database.
Junilu Lacar
Bartender

Joined: Feb 26, 2001
Posts: 4756
    
    7

I don't think it's as much a matter of good coding "style" as making good design decisions: use the tool most appropriate for the job. As Lasse indicated, you can use your own custom servlet/s to process the non-interactive requests and use Struts to process normal user requests.

As for Struts vs. servlet performance, check out this article by Ted Husted.

And if you're really concerned about performance, prefer using a profiler over intuition or advice from others to help you make your design decisions.


Junilu - [How to Ask Questions] [How to Answer Questions]
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Originally posted by Junilu Lacar:
And if you're really concerned about performance, prefer using a profiler over intuition or advice from others to help you make your design decisions.

Very good point.
sarah Marsh
Ranch Hand

Joined: Mar 06, 2001
Posts: 282
Actually, there's almost no non-interactive requests.
What do you mean 'profiler'? Thanks!
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Originally posted by sarah Marsh:
What do you mean 'profiler'?

Profilers are programs that monitor the execution of your application and tell you where those CPU cycles are going (i.e. which methods take the longest times to execute, which methods take the most time accumulatively, etc.), how much memory your application consumes, detects memory leaks, how many objects of each type are being created, etc. In other words, they tell you where your performance bottlenecks are.

One example of a profiler is JProfiler by ej-technologies.
 
 
subject: struts performance