It has been noted by multiple people that classpath scanning that we do causes:
- OutOfMemory errors when out-of-process node or webserver is started;
- Affects performance of test pack execution since classpath scanning is happening multiple times.
Few code pointers in this regard:
- AbstractAMQPSerializationScheme.customSerializers does an extensive scan across all the jars in the classpath including 3rd party libraries for instances of SerializationCustomSerializer;
- ClassloaderUtils.scanJarForContracts performs scan for instances of Contract including our core module. Every such scan takes approximately 1 second. When core excluded scan takes around 50ms