I have a java web app which have in its \WEB-INF\lib\ folder around 679 jars. I have read the classloaders (the app is using TomcatEmbeddedWebappClassLoader) read in alphabetical order this folder in order to find a class and load it. If this is the way, a class that its contained in the last jar will take much more time to find it by the classloader than its contained in the first jar in the list.
- Is this true that the classloader reads the contents of lib folder in alphabetical order?
- Is not there any optimization in order the classloader finds a class in a huge list of jars? Or it just unzips jar by jar in order to find the class?
Thanks