This is due to code in JUnitTestSamplerGui#setupClasslist. The slowdown can be of few minutes depending on number of jars, and happens even if test does not use JUnit at all. The workaround is to move ApacheJMeter_junit.jar out of lib/ext folder.
The fix is to move initialization out of Constructor. By the way avoid recomputing classes each time component is displayed which can have a big cost if there are many jars. The only drawback is that added jars in Test Plan will not be taken into account anymore. @Team, can this fix be reviewed ? Thank you
pmouawad@apache.org 11:04 PM (2 minutes ago) to commits Author: pmouawad Date: Fri Sep 28 21:04:45 2018 New Revision: 1842283 URL: http://svn.apache.org/viewvc?rev=1842283&view=rev Log: Bug 62775 - If many jars are in a folder referenced by user.classpath, startup can be extremely slow due to JUnit Bugzilla Id: 62775 Modified: jmeter/trunk/src/junit/org/apache/jmeter/protocol/java/control/gui/JUnitTestSamplerGui.java jmeter/trunk/xdocs/changes.xml
(In reply to Philippe Mouawad from comment #1) > The fix is to move initialization out of Constructor. > By the way avoid recomputing classes each time component is displayed which > can have a big cost if there are many jars. > > The only drawback is that added jars in Test Plan will not be taken into > account anymore. No there is no regression , since SPATH used to scan is initialized in static block > > > @Team, can this fix be reviewed ? > > Thank you
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/4878