One other thing.. As far as startup times go, I it should be possible for Guice to support a binding cache. I just don't know how difficult this would be for someone to implement. If this were implemented even a 10-15 second binding would be much more tolerable if it were just a one-time startup/"installation" operation.
On Wednesday, June 20, 2012 8:11:04 AM UTC-5, glenviewjeff wrote: > > Christian, 95% of the startup code is Guice binding code; and there's zero > I/O, database/network operations, etc. If you're an Android developer, (or > even if you're not but are willing to install the Android tools so you can > use Traceview), I can send you the tracing file if you'd like to see for > yourself. > > On Wednesday, June 20, 2012 8:05:11 AM UTC-5, Christian Gruber wrote: >> >> At this point there is no such beast. createInjector() is a builder, and >> creates an intact Injector. >> >> Having said that, you could do something like this with child injectors, >> but I worry that you would be swapping in a child injector for its parent >> in a running system, and there are a hell of a lot of concurrency issues at >> play with that. >> >> But the way you describe… incrementally adding more modules to an >> existing injector - that sort of goes against the design of Guice, which is >> that the injector is built with all the information it needs to satisfy >> bindings. >> >> We need to do more work on profiling and I think Jesse has some ideas on >> removing reflection from the mix, but I haven't really gotten a chance to >> talk a lot of that through. But start-up times are a definite thing I'm >> going to be looking at in the next while. >> multiinder >> A few questions on that… are you doing initialization work in your >> constructors/providers? Can you separate out expensive operations into >> service startup methods, and maybe use a MulltiBinder to register services, >> and have them started up separately? A lot of startup times can be >> mitigated by doing less work in the wiring itself, which is already not >> recommended. I don't know your design, so I can only comment abstractly. >> >> Christian >> >> On Jun 20, 2012, at 8:34 AM, glenviewjeff wrote: >> >> I'm developing using Guice on Android via Roboguice, and reflection and >> other operations that Guice uses for binding are horrifically slow. Before >> I started optimizing my Guice modules, it was taking about 15 seconds for >> the app to start. >> >> I'm wondering if I could start with a simple injector that configures >> just the modules necessary to start up the main screen of the application, >> and then perform the remaining configuration on a background thread. To do >> this, I wouldn't want to repeat the work done in the first createInjector, >> and ideally would do something like injector.addModules(...), which of >> course does not exist. >> >> Is there a way to do this? >> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "google-guice" group. >> To view this discussion on the web visit >> https://groups.google.com/d/msg/google-guice/-/bFax3gkE66oJ. >> 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?hl=en. >> >> >> -- You received this message because you are subscribed to the Google Groups "google-guice" group. To view this discussion on the web visit https://groups.google.com/d/msg/google-guice/-/F2VOQIx3BlwJ. 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?hl=en.
