-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Description
Issue details
Issue
Jadx currently finds the exact node location for code searches. This significantly slows down search performance when retrieving a large number of results, especially for common text searches.
Optimization Proposal
When opening a new tab in the search results, getEnclosingNode is used to create a CodeNode in the search dialog. However, since the item's position is already known, resolving the exact node location is unnecessary. Instead, we can use the class node of the found text directly:
Current code (slow search):
JNode enclosingNode = getOrElse(getEnclosingNode(javaClass, end), rootCls);
Proposed change (instant search):
JNode enclosingNode = convert(wrapper.getJavaNodeByRef(javaClass.getCodeNodeRef()));
Results
With this change, search performance improves significantly(instant). I have tested this modification, clicking on search results correctly jumps to the expected location in Jadx without the additional overhead of exact node resolution.
Jadx version
dev
Java version
21.0.5
OS
- Windows
- Linux
- macOS
