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.
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.
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.
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.