Hi Andy,

Object creation is extremely fast in modern JVMs and avoiding it shouldn't
be used in order to speed up the program unless
you have a very specific case where you've shown it to be relevant.

+ in guice it allows you to bypass the scoping layer, look at
http://code.google.com/p/google-guice/wiki/Scopes (Choosing a Scope, and
also the comment #3).



2011/4/22 Andy <[email protected]>

> The service i'm using here just performs standard CRUD operations
> against a database.  I'm injecting it into several different actions
> in Struts2
>
> Why is it faster to inject a non singleton?  I was anticipating a
> singleton to perform better in terms in memory usage and injection
> speed because of not needing to instantiate a new instance for each
> injection.
>
> Thanks for your answer!
>
> --
> You received this message because you are subscribed to the Google Groups
> "google-guice" 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?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"google-guice" 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?hl=en.

Reply via email to