Dagger and Guice work differently. Dagger moves some validation to
compile-time, and has a smaller run-time startup footprint. This can
affect apps where startup-times are particularly high-cost, such as
Android. Appengine also has some issues here, because Guice validates a
lot of stuff at Injector creation time. App engine's propensity to
destroy and recreate server instances means that guice's validation
costs will be incurred more frequently than it would on other platforms.
We have not performed benchmarks of the kind you're thinking about
between Guice and Dagger. I'm on the guice and dagger teams, and our
concerns around dagger have more to do with compile-time validation, and
performance in some specific environments.
At this point, I would say that Guice has some initial startup costs,
but also has a much more fully articulated support for java servlet APIs
and better tooling on the server in general. I wouldn't hesitate to use
it on app engine, but I would tend to make sure that I don't make
crazily huge graphs. Appengine apps should be fairly light in the first
place, possibly woven together, to best take advantage of the design of
the app engine platform. If you're getting rather heavy duty startup
costs from Guice, you might be over-using the dependency-injection
pattern, whether you end up using Guice or Dagger (or any other). Your
mileage may vary of course.
That said, we should do some profiling and see if there are wasteful
places in guice startup where we can improve the app-engine case.
Christian.
On 13 Jan 2014, at 13:07, Alexnet wrote:
Hi, I found many old topics here and on Appengine group blame Guice
about
startup time. Some people migrating to http://square.github.io/dagger/
.
However today we have Guice 4. I would like to know about startup time
improvements and benchmarks of Guive vs Dagger.
Cheers
--
You received this message because you are subscribed to the Google
Groups "google-guice" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-guice.
For more options, visit https://groups.google.com/groups/opt_out.
Christian Gruber :: Google, Inc. :: Java Core Libraries :: Dependency
Injection
email: [email protected] :::: mobile: +1 (646) 807-9839
--
You received this message because you are subscribed to the Google Groups
"google-guice" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-guice.
For more options, visit https://groups.google.com/groups/opt_out.