[weld-dev] @New beans
Stuart Douglas
stuart.w.douglas at gmail.com
Sun Nov 14 01:18:49 EST 2010
Not according to the spec.
Sent from my iPhone
On 14/11/2010, at 17:13, Nicklas Karlsson <nickarls at gmail.com> wrote:
> You can still get a @New bean programmatically from the BM even if it's not injected?
>
> On Sun, Nov 14, 2010 at 1:44 AM, Stuart Douglas <stuart.w.douglas at gmail.com> wrote:
> After doing some more profiling I think we can massively reduce startup time for a large number of beans.
>
> At the moment we add an @New bean for every managed bean, while according to the spec I think this is only necessary for beans that are actually injected into an @New injection point. I performed a quick test where I removed the @New beans (and skipped the tests) and in the 5000 bean case it reduced the AS startup time form 90s to 60s (this is actually a 50% speedup as the AS takes 30s to start with a 5000 class deployment without weld), and reduces the memory usage by a further 20Mb (bringing the total saving so far to 100Mb). This speedup will probably be less for smaller deployment, because parts of the startup process are O(n^2) on the number of beans (in particular TypeSafeResolver.findMatching).
>
> Is my interpretation of the spec correct? The spec actually says that these @New beans that do not match an injection point still exist but are disabled, which as far as I can tell is the same as just not creating them.
>
>
> Stuart
> _______________________________________________
> weld-dev mailing list
> weld-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/weld-dev
>
>
>
> --
> ---
> Nik
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/weld-dev/attachments/20101114/81970f82/attachment.html
More information about the weld-dev
mailing list