« Return to Thread: Struts 2 performance

Re: Struts 2 performance

by cilquirm :: Rate this Message:

Reply to Author | View in Thread

I've found that static html pages are blazing fast, especially those that don't involve stylesheets, images, or javascript includes.  :-)

Seriously, though, I don't think there's any disagreement that ognl ( or any runtime expression language ) adds a certain amount of overhead, but I've never seen any of my servers pinned that high, and I've been working with WW2/S2 for probably around 3 years now.

At the end of the day, I can argue to my company that we'll get faster performance by switching to servlets and straight jsp, but I don't want to be the one debugging that when it all goes to pot. I'm all for the minor tradeoff on performance for the incredibly superior gains in productivity and general developer happiness that S2 affords me.

my2c,
-a

P.S.  One thing you can do, if you're so inclined once you've tried out the other performance tips, is to give ognl 2.7 a go.  You can get it via the Tapestry libs download.  It's a straightforward replacement, just drop in  ognl.jar and javassist.jar and start up.  

I've done it here and it hasn't really changed my perception of my webapp but YMMV


climbingrose wrote:
Hi all,

I've been developing Struts 2 webapp for nearly a year now and have a great
deal of experience with it. Personally, the architecture of Struts 2 is much
cleaner than its predecessor. However, recently I converted one of my Struts
2 pages into Servlet + JSP solution and it turns out that Struts 2
performance is much worse than Servlet + JSP. In Servlet + JSP solution, the
server CPU is barely over 3-4% while with Struts 2, it's around 70% most of
the time. The JSP page is around 300 lines of code. I don't have a chance to
do any profiling to find out where is the bottleneck but I suspect it might
be OGNL which hinders the performance. I think, we already have a pretty
good feature set so we can start thinking about optimising Struts 2. That
will probably speed up its adoption in the industry.



The other thing I want to comment on is the use of Dojo as Ajax theme. I
don't have much experience with Dojo apart from a few hours playing around
with it. However, even with the latest version (0.9), Dojo just seems to be
to heavy weight for most purposes. I mean if you only want a bloody calendar
in your webapp, you don't want to load up a 100kb of  javascript. Plus, it
might be my experience only, Dojo seems to have the tendency to hang my
browser everytime I open a Dojo-based app.

--
Regards,

Cuong Hoang

 « Return to Thread: Struts 2 performance