we are using Guice on App Engine. One trick we have used is to annotate all classes we want to bind to Guice with @AutoBind and use the fantastic
classindex library to simply read them all from a compile-time generated file. No classpath scanning! Unfortunately, as we were adding class after class, now the Guice setup takes around 1.5 seconds. In a cloud environment where instances are constantly started and shut down this has a big impact. The profiler tells us that classpath loading is responsible for the lion share.
So long story short: How to delay the classloading until it is really needed? Something like bind("com.example.MyClass")?