Thanks Dmitry, that's an interesting solution. You could easily make it eager load in production mode only that might be a fairly lucrative option for many.
Kalle On Sun, May 12, 2013 at 12:29 AM, Dmitry Gusev <dmitry.gu...@gmail.com>wrote: > On Sat, May 11, 2013 at 1:20 PM, Dmitry Gusev <dmitry.gu...@gmail.com > >wrote: > > > This may work... but how would I know which services I need for that > page? > > I want as much as possible. > > > > I did some research and found that there's no such global option. > > > > I did some reflection hack to call eagerLoad() on service definitions > from > > ServletContextAttributeListener, but that breaks something. > > > > Everything seems to work at the first look but I wanted to measure page > > load time and > > found that my TimingFilter (from AppModule.buildTimingFilter()) isn't > > executing. > > > > I can see its created during registry startup but it never gets called... > > Not sure why is that, need more research. > > > > > My bad, forgot to contribute that request handler, it works now. > > And I've found a better, more Tapestry way to implement this -- using > ApplicationInitializers: > > https://gist.github.com/dmitrygusev/5562739 > > Without initializer: > > 85,83% unrealized services (218/254) > > With this initializer: > > 9,06% unrealized services (23/254) > > For my app startup time increased 2x, first request time faster approx 2x > also. > > > > On Fri, May 10, 2013 at 6:09 PM, Barry Books <trs...@gmail.com> wrote: > > > >> EagerLoad is a pain when developing. I my opinion you should kill two > >> birds > >> with one stone. Setup a monitor page that includes the services you want > >> to > >> eager load and point a website monitor at it. Then it takes the startup > >> hit > >> instead of your users and you also know when the site is broken. > >> > >> > >> On Fri, May 10, 2013 at 7:27 AM, Lance Java <lance.j...@googlemail.com > >> >wrote: > >> > >> > You can annotate individual service builder methods in AppModule with > >> > @EagerLoad. There's also ServiceBindingOptions.eagerLoad() available > for > >> > bind(). > >> > > >> > Not sure if there's a global option. > >> > > >> > > > > > > > > -- > > Dmitry Gusev > > > > AnjLab Team > > http://anjlab.com > > > > > > -- > Dmitry Gusev > > AnjLab Team > http://anjlab.com >