0 Replies Latest reply on Dec 15, 2009 8:46 AM by Alessio Soldano

    WebCtxLoader$ENCLoader optimization

    Alessio Soldano Master


      I'm currently working on performance analysis for the JBossWS project and looking at the differences in terms of perfomances we have comparing results achieved using EJB3 endpoints and POJO endpoints. In the latter case the classloader being used and set as context classloader is an instance of org.jboss.web.tomcat.service.WebCtxLoader$ENCLoader. Looking at the code and comments for that, I see:


          * A trival extension of URLClassLoader that uses an empty URL[] as its
          * classpath so that all work is delegated to its parent.
         static class ENCLoader extends URLClassLoader {

            private URL[] urllist = new URL[0];

            ENCLoader(ClassLoader parent)
               super(new URL[0], parent);




      so I'm wondering if we could directly delegate the loadClass to the parent overwriting loadClass(String name), which would also prevent going through an additional synchronized method in java.lang.ClassLoader (loadClass(String name, boolean resolve)).

      I've tried that locally and see something like 5% perf improvements in my testing conditions, but I might be missing something about the purpose of that ENCLoader..