Bug 62775 - If many jars are in a folder referenced by user.classpath, startup can be extremely slow due to JUnit
Summary: If many jars are in a folder referenced by user.classpath, startup can be ext...
Status: RESOLVED FIXED
Alias: None
Product: JMeter
Classification: Unclassified
Component: Main (show other bugs)
Version: 3.0
Hardware: PC All
: P2 major (vote)
Target Milestone: JMETER_5.1
Assignee: JMeter issues mailing list
URL:
Keywords: FixedInTrunk
Depends on:
Blocks:
 
Reported: 2018-09-28 20:27 UTC by Philippe Mouawad
Modified: 2018-09-28 21:10 UTC (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Philippe Mouawad 2018-09-28 20:27:56 UTC
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.
Comment 1 Philippe Mouawad 2018-09-28 21:07:50 UTC
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
Comment 2 Philippe Mouawad 2018-09-28 21:08:02 UTC
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
Comment 3 Philippe Mouawad 2018-09-28 21:10:02 UTC
(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