Comment #2 on issue 505 by mmastrac: Guice Servlet should allow for on-demand instantiation of servlets
http://code.google.com/p/google-guice/issues/detail?id=505
When running on AppEngine, the first request after a JVM shutdown always includes this Guice startup time. Unfortunately, for low-volume applications, this first request can happen as often as once per minute. In the case of our application, the total time to run the Guice module code, load all required classes from everything in the module, bind the servlets and serve the first request ends up being around 10s. The end result of this is that the first person to hit our application every minute basically has to wait 10s for it to come alive.
I used YourKit and Guice's stopwatch logs to profile my application's startup and there's not much going on there beyond simple classloading. I hacked up a filter that lived in front of GuiceFilter (and subclassed GuiceFilter to lazily initialize the module on the first request rather than using a servlet context listener). This filter manages to serve the first request in under 3s. This is probably around the fastest you can get a JVM to come back to life on AppEngine.
I believe that solving this would cut down our application's startup time by approximately 50% by not initializing every class to serve the first request (which is likely the homepage and can be served by memcache in most cases).
-- You received this message because you are subscribed to the Google Groups "google-guice-dev" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-guice-dev?hl=en.
