eclipse-jdt / eclipse-jdt/eclipse.jdt.ui

Opening the Run Configurations dialog with a JUnit launch config can be slow

Open
#2,905 15 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
59
Forks
127
Avg merge
23h 30m
Merged PRs (30d)
35

Description

see: https://github.com/groovy/groovy-eclipse/issues/1659

When opening the Run Configurations dialog, the `TestSearchEngine` kicks in -- presumably to populate this group of controls:
Image

**1)** Is it possible to defer searching for test methods until the _Search..._ button is pressed?

-----

For any test type with a super class or super interface(s) there is an expensive computation:
https://github.com/eclipse-jdt/eclipse.jdt.ui/blob/9d72b01bc21e7aa44269514b09db3d8d05725ffb/org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/util/TestSearchEngine.java#L92

It is costly to look up a type name within the context of a source unit, using `getResolvedType` -- it requires a full parse and resolve that is discarded.

**2)** Would it be better to use `ITypeHierarchy superTypes = type.newSupertypeHierarchy(subMonitor.split(1));` to compute the entire type hierarchy, which could then be iterated for test method discovery?

@kernanj

Contributor guide

Open the contributing guide

Research direction

Start by reading eclipse.jdt.ui's org/eclipse/jdt/internal/junit/util/TestSearchEngine.java around line 92 and tracing how the Run Configurations dialog invokes it. Reproduce the slow JUnit launch-configuration workflow, measure dialog opening and test search separately, and use the findings to define the accepted behavior and regression coverage.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
desktop, performance, testing-qa
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.