3 Replies Latest reply on Nov 23, 2010 6:05 PM by Stuart Douglas

    Weld boot performance

    Stuart Douglas Master

      Over the last 2 weeks I have been working on Weld's boot performance, and have managed to reduce it considerably (see here for full details).

       

      At the moment the biggest bottleneck is classloading, which consumes about 50% of the startup time. I think a possible solution to this in as7 would be to begin loading the classes eagerly and asynchronously, as soon as a module with a beans.xml is discovered, so that by the time weld starts to boot the majority of the classloading has already been completed.

       

      Does this sound like a workable approach?

        • 1. Re: Weld boot performance
          David Lloyd Master

          Sure, but I'd say get the integration working first so you have a baseline.

           

          Looking at it from another angle, another possible solution is to reduce the total number of classes loaded at boot.  Maybe the new annotation processing architecture can help here.

          • 2. Re: Weld boot performance
            Jason Greene Master

            David Lloyd wrote:

             

            Looking at it from another angle, another possible solution is to reduce the total number of classes loaded at boot.  Maybe the new annotation processing architecture can help here.

            Right this is an important distinction. It's likely that a only subset of classes in a deployment will be of interest to weld during deployment.

            • 3. Re: Weld boot performance
              Stuart Douglas Master

              I may be getting a bit ahead of myself thinking about performance at this stage :-)

               

              The problem is that according to the spec Weld has to fire ProcessAnnotatedType for every class in the bean archive. Weld does have a non-portable extension to limit the classes that are scanned, but in the general case there is not really any way around this. Even if you could build the meta model from other sources without loading the class (which I am not sure is possible), as soon as portable extensions enter the mix you are almost certainly going to have to load the class anyway.