Use case
Description
In JMeter, when a sampler fails with onErrorStartNextLoop enabled, or when loop logical actions (such as Break/Continue) are triggered, JMeter is forced to find the parent controller hierarchy from the current sampler up to the thread group root.
Currently, this is done by executing testTree.traverse() with a FindTestElementsUpToRootTraverser every time the loop action is triggered. For large test plans with deep nesting structures, this full DFS tree walk is highly redundant since the test tree's hierarchical structure does not change during the execution run. This leads to severe performance degradation and high CPU usage under high-failure loads.
Possible solution
Proposed Improvement
Add a thread-local parent controller path cache (Map<Sampler, List<Controller>>) inside JMeterThread. When resolving parent controllers:
- Query the map to see if the sampler's parent controllers list has already been resolved.
- If it is a cache miss, perform the
testTree.traverse() once and store the result.
- If it is a cache hit, return a lightweight mock traverser containing the cached controllers list directly, completely skipping the expensive DFS tree traversal.
Possible workarounds
No response
JMeter Version
6.0.0-SNAPSHOT
Java Version
No response
OS Version
No response
Use case
Description
In JMeter, when a sampler fails with
onErrorStartNextLoopenabled, or when loop logical actions (such as Break/Continue) are triggered, JMeter is forced to find the parent controller hierarchy from the current sampler up to the thread group root.Currently, this is done by executing
testTree.traverse()with aFindTestElementsUpToRootTraverserevery time the loop action is triggered. For large test plans with deep nesting structures, this full DFS tree walk is highly redundant since the test tree's hierarchical structure does not change during the execution run. This leads to severe performance degradation and high CPU usage under high-failure loads.Possible solution
Proposed Improvement
Add a thread-local parent controller path cache (
Map<Sampler, List<Controller>>) insideJMeterThread. When resolving parent controllers:testTree.traverse()once and store the result.Possible workarounds
No response
JMeter Version
6.0.0-SNAPSHOT
Java Version
No response
OS Version
No response