You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by jhomuth <jo...@sourcepark.de> on 2008/09/23 16:27:30 UTC

MyFaces Performance

Hi List,

if started two weeks ago developing with MyFaces and Apache Tiles. 
Furthermore I use the Tomahawk UI Library. I was wondering about the 
performance of my web-app. It is really really slow.
I develop on an Quad Core Pc with 4GB RAM and I think thats not the 
reason why it is so slow.

A little example of one of requests.

1. User selects something in a "selectOneMenu"
2. After that the user pushes a "GO" Button which calls an Action in a 
managed bean.
3. The Code in that action method will be called. (only 3 Lines of Code)
4. The outcome String will be returned from that method and the other 
view is renderd.

And that takes over 5 seconds (sometimes little bit quicker)

Do anyone know about big performance issues and if how i can fix that?

Thx for suggestions


Re: MyFaces Performance

Posted by Simon Lessard <si...@gmail.com>.
Hi,

You have your problem then :). As for my third question, you could have had
a performance issue there as well. Imagine you have:

1 none scoped bean named "injected"
1 request scoped bean named "controller" called by your button and on which
you inject the first bean.

Now, imagine "injected" constructor does something really costly like
multiple database calls or something, then calling the action on the
"controller" bean will also be long for the first call for the actions to
resolve in order will be to instanciate "controller" (fast), instanciate
"injected" (slow), inject "injected" (fast) and finally call the action
(fast). In the end, even if everything looks fast in your "controller" bean,
it would still be slow because of "injected" instanciation. If you ever have
such use case, try to make "injected" lifespan longer, like session or
application. It might of course not always be possible though.


Regards,

~ Simon

On Tue, Sep 23, 2008 at 11:45 AM, Johannes Homuth <
johannes.homuth@sourcepark.de> wrote:

> Hello Simon,
>
> You are right, if I call the site again, it will be much faster. I think it
> was the JSP Complation. I always redeployed my app after some changes and
> thought that this JSP Site will be precompiled, but regarding your statement
> i quess it will be compiled at first access.
>
> I just looked in the Internet and I quess I will have to use a
> JSPPreCompileListener to solve this problem.
>
> Thx Simon!!!
>
> PS: Regarding your other suggestions.My bean is in request scope and yes I
> inject some properties. Furthermore the method doesn't call a database, or
> better to say, not yet.
>

Re: MyFaces Performance

Posted by Johannes Homuth <jo...@sourcepark.de>.
Hello Simon,

You are right, if I call the site again, it will be much faster. I think 
it was the JSP Complation. I always redeployed my app after some changes 
and thought that this JSP Site will be precompiled, but regarding your 
statement i quess it will be compiled at first access.

I just looked in the Internet and I quess I will have to use a 
JSPPreCompileListener to solve this problem.

Thx Simon!!!

PS: Regarding your other suggestions.My bean is in request scope and yes 
I inject some properties. Furthermore the method doesn't call a 
database, or better to say, not yet.

Re: MyFaces Performance

Posted by Simon Lessard <si...@gmail.com>.
Hi,

What happen if you re-access the first page after and repress the button?
Furthermore, are you using Facelets or JSP? I can see many reasons:

1. First access mean JSP compilation, so 5 seconds would be understandable
on first access
2. What is the action doing in 3 lines of code? If it access the database
(it's possible in 3 lines after all) you may have an overhaul there as well.
3. What is the scope of the managed bean and are you injecting anything in
it?


Regards,

~ Simon

On Tue, Sep 23, 2008 at 10:27 AM, jhomuth <jo...@sourcepark.de>wrote:

> Hi List,
>
> if started two weeks ago developing with MyFaces and Apache Tiles.
> Furthermore I use the Tomahawk UI Library. I was wondering about the
> performance of my web-app. It is really really slow.
> I develop on an Quad Core Pc with 4GB RAM and I think thats not the reason
> why it is so slow.
>
> A little example of one of requests.
>
> 1. User selects something in a "selectOneMenu"
> 2. After that the user pushes a "GO" Button which calls an Action in a
> managed bean.
> 3. The Code in that action method will be called. (only 3 Lines of Code)
> 4. The outcome String will be returned from that method and the other view
> is renderd.
>
> And that takes over 5 seconds (sometimes little bit quicker)
>
> Do anyone know about big performance issues and if how i can fix that?
>
> Thx for suggestions
>
>