[Opensource] Controller instantiation (in 4.02)
Michael Rimov
rimovm at centercomp.com
Sun Jul 14 13:19:56 PDT 2002
At 07:47 AM 7/14/2002 -0400, you wrote:
>I'm doing some profiling of my application and it turns out that a large
>fraction (more than half) of my response time is from the intantiation of
>controllers. I typically transition to five or six different controllers and
>often transition within a controller during a single page generation.
>
>I use both Controlller.transition and Transition.transition and notice
>that the
>Controller method will avoid re-instantiating a controller if it is an
>internal
>transition (good) but that the Transition method does not (not as good). Is
>there any reason why "Transition" shouldn't behave the same way?
>
>I'll also ask (perhaps naively) why Controllers need to be instantiated for
>every request. It seems that all state information is safely encapsulated in
>the request/response objects.
They shouldn't be instantiated like that. In 4.1 there's a controller
factory that will instantiate one and only one under Struts, and cache
instances under non server environments.
HTH!
-Mike
More information about the Opensource
mailing list