tycho icon indicating copy to clipboard operation
tycho copied to clipboard

Performance problem in classpath validation

Open Bananeweizen opened this issue 2 years ago • 0 comments

Just noticed that for many of my plugins the classpath validation takes longer than the actual compilation, as can be seen in the time measurements per goal in maven debug mode (where times are wallclock time): image

Running the same build under a profiler, it confirms that (with the times being a mixture of CPU time and wallclock time): image

Be aware this is Windows and a virus scanner is enabled, so you may see much smaller numbers without these constraints. The location.exists() check was introduced in 67e87d873a8bf264d3cf40ece7fda28a14589439. While that check is reasonable by itself (with the goal of re-trying failed downloads), we should try to have that file existence check at some other place (like moving it to all places where the locationResolver is used, and not setting location if the file is missing afterwards).

Besides trying to not check file existence on each resolution, I'm also wondering if that mojo can be improved to have a state over multiple compilations. In a multi module project the files to be resolved (and checked for existence) will always be the same dependency jars again and again, so that repeated check makes even less sense. Would some kind of caching over invocations be possible? I have to little understanding of the inner details...

Bananeweizen avatar Jun 11 '23 12:06 Bananeweizen