File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

struts performance

 
sarah Marsh
Ranch Hand
Posts: 282
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 11962
5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
sarah Marsh
Ranch Hand
Posts: 282
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you. It's online application for supply chain. Mixing custom servlet with struts is the good coding style?
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 282
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 6547
21
Java Linux Mac Scala Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 282
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually, there's almost no non-interactive requests.
What do you mean 'profiler'? Thanks!
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic