Skip to content

Conversation

@aschackmull
Copy link
Contributor

#20380 didn't quite cut it - there were many more cases of broken performance. This covers most things, I think.

@aschackmull aschackmull requested a review from a team as a code owner September 8, 2025 12:09
Copilot AI review requested due to automatic review settings September 8, 2025 12:09
@aschackmull aschackmull added the no-change-note-required This PR does not need a change note label Sep 8, 2025
@github-actions github-actions bot added the Java label Sep 8, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes performance issues in Java CodeQL queries by adding pragma[nomagic] annotations and pragma[only_bind_out] / pragma[only_bind_into] directives to optimize query evaluation. These pragmas help the CodeQL evaluator make better decisions about join ordering and variable binding to avoid expensive cartesian products.

Key changes:

  • Added performance optimization pragmas to predicates and variable bindings
  • Refactored query structure to improve evaluation efficiency
  • Replaced transitive closure with iterative predicate for better performance

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
java/ql/src/Likely Bugs/Likely Typos/SelfAssignment.ql Added pragma[nomagic] and pragma[only_bind_out] to optimize predicate evaluation
java/ql/src/Likely Bugs/Frameworks/Swing/BadlyOverriddenAdapter.ql Added pragma[nomagic] and refactored query structure to extract candidate method into separate predicate
java/ql/src/Likely Bugs/Collections/RemoveTypeMismatch.ql Added pragma[only_bind_into] to optimize parameter index binding
java/ql/src/Likely Bugs/Collections/ContainsTypeMismatch.ql Added pragma[only_bind_into] to optimize parameter index binding
java/ql/lib/semmle/code/java/frameworks/android/ExternalStorage.qll Replaced recursive transitive closure with iterative predicate for better performance
java/ql/lib/semmle/code/java/dataflow/internal/TaintTrackingUtil.qll Added pragma[only_bind_into] to optimize argument index binding

@aschackmull aschackmull force-pushed the java/fix-more-broken-perf branch from 8e8c5ff to 4c1fa58 Compare September 8, 2025 12:12
@IdrissRio IdrissRio merged commit dc247e0 into github:main Sep 8, 2025
17 checks passed
@aschackmull aschackmull deleted the java/fix-more-broken-perf branch September 9, 2025 05:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Java no-change-note-required This PR does not need a change note

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants