You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Yan Hu <ya...@yahoo.com> on 2005/05/10 22:50:04 UTC

Is struts more performant than JSF

Hi:
I have been playing with JSF lately.  I really like it since it is very intuitive.  But as I
understand it, JSF keeps a component tree for each page with JSF widgets in it on the server. So
it is heavy weight compared with struts. Could I safely say that struts-based apps are a bit more
performant than JSF ones? someone please shed some light on it.......



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Is struts more performant than JSF

Posted by Dakota Jack <da...@gmail.com>.
The JSF is an event-based framework with tight coupling in a
page-based controller.  That should answer the question in itself.  If
you want that, then you will put up with the performance and CPU hit. 
You might even put up with the performance and CPU hit if you are hell
bent on using tools instead of custom coding.  I think the tool boys
are really not saving in the long run because too much is left to a
lack of knowledge which will cost in the long run with maintenance
headaches.  But, pushing a button is faster than coding at the
beginning: no doubt about that.

On 5/10/05, Yan Hu <ya...@yahoo.com> wrote:
> Hi:
> I have been playing with JSF lately.  I really like it since it is very intuitive.  But as I
> understand it, JSF keeps a component tree for each page with JSF widgets in it on the server. So
> it is heavy weight compared with struts. Could I safely say that struts-based apps are a bit more
> performant than JSF ones? someone please shed some light on it.......
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 


-- 
"You can lead a horse to water but you cannot make it float on its back."
~Dakota Jack~

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Is struts more performant than JSF

Posted by Dakota Jack <da...@gmail.com>.
<SNIP>
On 5/12/05, Ted Husted <te...@gmail.com> wrote:
> :) The ones who get laughted out of my office are the ones who suppose
> a strategy is more performant without a test suite to prove it. :)
> 
> -Ted.
</SNIP>

My take is as follows:

A.  We try not to laugh at people around here for any reason.  
B.  Tests are important if you need them and supposing you do not need
them when you do is clearly a mistake.
C.  Tests are a waste of time if you do not need them and a "knee
jerk" decision to always test is as mistaken as any other non-thinking
activity.  One of the places tests may not be necessary is in choosing
between two frameworks.

There are some frameworks that are obviously "heavy" out of the box if
you undestand how computers work.  JSF is one of them.


-- 
"You can lead a horse to water but you cannot make it float on its back."
~Dakota Jack~

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: Is struts more performant than JSF

Posted by "Frank W. Zammetti" <fz...@omnytex.com>.
On Thu, May 12, 2005 10:26 am, Ted Husted said:
> On 5/12/05, Frank W. Zammetti <fz...@omnytex.com> wrote:
>> I don't know what kind of environment you work in, but if I suggested
>> writing an application twice just to determine which way we should have
>> done it in the first place, I'd get laughed all the way back to my
>> office
>> :) LOL
>
> Hmmm, I think I said one *iteration* of the application. Something
> that might be done in a few days or a couple of weeks. A large
> application might have fifty or more iterations. And, of course, one
> iteration would be kept.

Ah, that iterative approach :)  I wish we could get away with that as rule
here too.

typically, we'll still a waterfall organization, by and large.  We're the
type of place you need three months of discussion to produce a BRD, TRD,
so on and so forth, get signoff by everyone in the company seemingly,
before anyone writes one line of code, and by then the deadline is so
ridiculously tight that there's no way in the world you can do anything
interesting with the project.  Ugh. :)

We're changing a little bit, slowly, and I've personally been fotunate to
have been given a fair amount of lattitude over the years to just "git'r
done", but it's still not easy.

> :) The ones who get laughted out of my office are the ones who suppose
> a strategy is more performant without a test suite to prove it. :)

Agreed.  One thing that is pretty good here is that most decisions are
based on hard facts rather that suppositions at least.

I for one *do not* assume JSF is any worse than Struts, or anything else,
in terms of performance and CPU utilization.  Maybe it is, maybe it isn't.
 Until I have some numbers to sway me either way I won't make any
decisions based on those facets.  And as Craig said, if it gives you
enough benefit in other areas, some negatives might be offset.

But the CPU utilization issue was of particular interest to me because of
our hosting setup, hence my comments.

Frank


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: Is struts more performant than JSF

Posted by Ted Husted <te...@gmail.com>.
On 5/12/05, Frank W. Zammetti <fz...@omnytex.com> wrote:
> I don't know what kind of environment you work in, but if I suggested
> writing an application twice just to determine which way we should have
> done it in the first place, I'd get laughed all the way back to my office
> :) LOL

Hmmm, I think I said one *iteration* of the application. Something
that might be done in a few days or a couple of weeks. A large
application might have fifty or more iterations. And, of course, one
iteration would be kept.

:) The ones who get laughted out of my office are the ones who suppose
a strategy is more performant without a test suite to prove it. :)

-Ted.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: Is struts more performant than JSF

Posted by "Frank W. Zammetti" <fz...@omnytex.com>.
On Thu, May 12, 2005 6:46 am, Ted Husted said:
> If the decision between approaches is not obvious, then do the first
> interation of your application using both, and compare the results for
> yourself.

I don't know what kind of environment you work in, but if I suggested
writing an application twice just to determine which way we should have
done it in the first place, I'd get laughed all the way back to my office
:) LOL

That being said, I don't at all disagree with your underlying point...
Benchmarks you don't do yourself aren't useless, but your results could
vary so widely from them depending on what your doing that you can't make
a decision based soley on such benchmarks.

> If  the decision is not important enough to justify doing one
> interation twice, then you might as well flip a coin and move on :)

Interestingly, we had a rather good debate around here recently about
whether to use JSF or Struts for a new application... we ultimtely decided
to not use JSF at this time (while keeping an eye on it for the future),
but one of the issues that came up was CPU utilization...

The hosting environment we use here charges us back based on CPU
utilization, so this thread struck a chord with me.  We ultimately didn't
use that factor in our decision-making process, but if we had some
existing benchmarks comparing the two it would have been helpful anyway.

I don't know how common CPU utilization chargeback is, but it's a concern
for us here.

Frank

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Is struts more performant than JSF

Posted by Ted Husted <te...@gmail.com>.
On 5/10/05, Yan Hu <ya...@yahoo.com> wrote:
> Hi:
> I have been playing with JSF lately.  I really like it since it is very intuitive.  But as I
> understand it, JSF keeps a component tree for each page with JSF widgets in it on the server. So
> it is heavy weight compared with struts. Could I safely say that struts-based apps are a bit more
> performant than JSF ones? someone please shed some light on it.......

It wasn't long ago that we were having *exactly* the same conversation
regarding Struts versus scriptlet-based applications. The more things
change the more they stay the same :)

If performance is a primary concern, then the best advice is to run
your own benchmarks. When it comes to performance, it's not a good
idea to trust anyone else's tests, because your mileage can, and
probably will, vary. Often, we may not ever be talking about a
difference that makes a difference.

It's especially hard to compare performance between applications
written by different people at different times, perhaps for different
reasons. The Petstore debacle taught us that.

If the decision between approaches is not obvious, then do the first
interation of your application using both, and compare the results for
yourself.

If  the decision is not important enough to justify doing one
interation twice, then you might as well flip a coin and move on :)

-Ted.

PS - If you are coming from a  Struts background, a very good JSF
primer is "Mastering JavaServer Faces" by Dudney at all.

* http://opensource.atlassian.com/confluence/oss/pages/viewpage.action?pageId=139

Commissions for books purchased through this link go directly to the ASF.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Is struts more performant than JSF

Posted by Craig McClanahan <cr...@gmail.com>.
On 5/10/05, Yan Hu <ya...@yahoo.com> wrote:
> Hi:
> I have been playing with JSF lately.  I really like it since it is very intuitive.  But as I
> understand it, JSF keeps a component tree for each page with JSF widgets in it on the server. So
> it is heavy weight compared with struts. Could I safely say that struts-based apps are a bit more
> performant than JSF ones? someone please shed some light on it.......
> 

As with everything in life, there are tradeoffs.  What you quoted
above is an example (but only matters if you choose client side state
saving; for server side the tree just sits in memory in the session
instead).  On the other hand, JSF does more for you that you have to
do by yourself in a Struts app (such as using a form bean, and then
having to do things like BeanUtils.copyProperties() in your action).

I've never done any exhaustive timings, but am pretty familiar with
the internal implementation of the Struts tags and the JSF RI code
(haven't looked deeply at the MyFaces implementation, but the JSF RI
code is not a useful predictor for the performance there):

* Rendering from Struts custom tags and corresponding JSF component tags
  - slightly more complexity in the JSF case.  (Rendering is more complex
  for more complex components, but that's functionality Struts doesn't have
  so it's not really something you can compare).

* Decoding of JSF components versus Struts ActionForm plus copying
  - slightly less complexity in the JSF case.

* Server side validation - roughly a push.

* Request processing lifecycle - roughly a push.

On the other hand, even if there turns out to be a non-trivial
difference, it's still unlikely that your users will perceive the
difference, unless CPU time on the machine running your servlet
container is your most important performance bottleneck.  That tends
not to be the case with web applications, where database and network
latencies tend to dominate.

Bottom line -- I would not use runtime performance as a decision point
for picking a web framework technology unless I knew I would be in a
CPU constrained environment.  Meeting functional requirements and
supporting easy, maintainable development are more important.

Craig McClanahan

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org