[java-dfa] PlainDescriptor: use identityHashCode

Improves LiveVariableAnalyzer performance, when there are many identically-named variables, as we have much less hash collisions
Improves IDEA-375149 Slow Java Debugger Data Views - ControlFlowAnalyzer.buildControlFlow()

GitOrigin-RevId: b9e7127cdfd2d4696f7066c3c48d5711cecab415
This commit is contained in:
Tagir Valeev
2025-06-30 12:27:19 +00:00
committed by intellij-monorepo-bot
parent 64671a5d65
commit 30f7d3ec26
3 changed files with 1197 additions and 1 deletions
@@ -34,7 +34,7 @@ public final class PlainDescriptor extends PsiVarDescriptor {
public PlainDescriptor(@NotNull PsiVariable variable) {
myVariable = variable;
myHash = Objects.hashCode(variable.getName());
myHash = System.identityHashCode(variable);
}
@Override
File diff suppressed because it is too large Load Diff
@@ -762,4 +762,6 @@ public class DataFlowInspectionTest extends DataFlowInspectionTestCase {
public void testIoContracts() { doTest(); }
public void testGetTernary() { doTest(); }
public void testClosureInConstructor() { doTest(); }
public void testHugeMethodFlow() { doTest(); }
}