Quantcast

Slow startup due to scaffolded controllers generation? Any way to generate them on-demand?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Slow startup due to scaffolded controllers generation? Any way to generate them on-demand?

gatherer
It is not rare to see people complaining about grails' slow startup in this mailing list or elsewhere, specially the step after "Configuring Spring Security ...". I have investigated this issue and have come to the conclusion that if you use scaffolding most time is spent generating the scaffolded controllers, and if you have a lot of controllers, which is not uncommon, it can take more that a couple of minutes for a simple restart.

I wonder why they aren't lazily generated like views, that is, generated on demand, as during development most sessions will only touch 3 or 4 controllers and the rest will be generated for nothing many times a day.

Is there any way/flag to enable the lazy controller generation or modify the process?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Slow startup due to scaffolded controllers generation? Any way to generate them on-demand?

Graeme Rocher-4
Administrator
Not currently, your best bet is to run grails generate-all and use
static scaffolding

On Tue, Nov 22, 2011 at 9:26 AM, gatherer <[hidden email]> wrote:

> It is not rare to see people complaining about grails' slow startup in this
> mailing list or elsewhere, specially the step after "Configuring Spring
> Security ...". I have investigated this issue and have come to the
> conclusion that if you use scaffolding most time is spent generating the
> scaffolded controllers, and if you have a lot of controllers, which is not
> uncommon, it can take more that a couple of minutes for a simple restart.
>
> I wonder why they aren't lazily generated like views, that is, generated on
> demand, as during development most sessions will only touch 3 or 4
> controllers and the rest will be generated for nothing many times a day.
>
> Is there any way/flag to enable the lazy controller generation or modify the
> process?
>
> --
> View this message in context: http://grails.1312388.n4.nabble.com/Slow-startup-due-to-scaffolded-controllers-generation-Any-way-to-generate-them-on-demand-tp4094857p4094857.html
> Sent from the Grails - user mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>



--
Graeme Rocher
Grails Project Lead
SpringSource - A Division of VMware
http://www.springsource.com

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Slow startup due to scaffolded controllers generation? Any way to generate them on-demand?

gatherer
OK I see. But cannot afford to regenerate all the controllers every time I change something in the scaffolding templates because I would have to keep track of which controllers are actually scaffolded and don't have to be regenerated and which methods have been overridden and have to be copied back to the regenerated controllers.

Are there any plans to add this feature to grails 1.3.X or 2.X? Is it difficult or time-consuming?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Slow startup due to scaffolded controllers generation? Any way to generate them on-demand?

Graeme Rocher-4
Administrator
Grails 2.0 already generates the scaffolded controllers in a
background thread, but only in development mode

Cheers

On Tue, Nov 22, 2011 at 12:13 PM, gatherer <[hidden email]> wrote:

> OK I see. But cannot afford to regenerate all the controllers every time I
> change something in the scaffolding templates because I would have to keep
> track of which controllers are actually scaffolded and don't have to be
> regenerated and which methods have been overridden and have to be copied
> back to the regenerated controllers.
>
> Are there any plans to add this feature to grails 1.3.X or 2.X? Is it
> difficult or time-consuming?
>
> --
> View this message in context: http://grails.1312388.n4.nabble.com/Slow-startup-due-to-scaffolded-controllers-generation-Any-way-to-generate-them-on-demand-tp4094857p4095238.html
> Sent from the Grails - user mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>



--
Graeme Rocher
Grails Project Lead
SpringSource - A Division of VMware
http://www.springsource.com

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Loading...