-
Notifications
You must be signed in to change notification settings - Fork 1.7k
JS: improve the join order of getAClassReference #8550
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
} | ||
|
||
pragma[noopt] | ||
private DataFlow::SourceNode getAClassReferenceStep(DataFlow::TypeTracker t) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private DataFlow::SourceNode getAClassReferenceStep(DataFlow::TypeTracker t) { | |
private DataFlow::SourceNode getAClassReferenceRec(DataFlow::TypeTracker t) { |
We have other cases of a type-tracking "step" predicates being factored out to fix a join ordering, but where some information about the edge itself is matched. This here is just the whole recursive case being factored, so I'd prefer a different name. I was certainly confused for a second, before realising that the noopt
is reason for factoring it out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but let's wait for the evaluation
I made a mistake in the inlining, which caused a test to fail, so this PR might have been for nothing. |
@@ -970,7 +970,7 @@ class ClassNode extends DataFlow::SourceNode instanceof ClassNode::Range { | |||
exists(DataFlow::TypeTracker t2, StepSummary summary, DataFlow::SourceNode prev | | |||
prev = this.getAClassReference(t2) and | |||
StepSummary::step(prev, result, summary) and | |||
t2 = t.append(summary) | |||
t = t2.append(summary) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Smells like a ql4ql query...
I ran an evaluation. No improvement on VSCode (which was the original intent), but other projects see a real performance improvement. I think we should merge this, and I should look into improving the join-order of our type-trackers. |
Saves ~10s on VSCode.
I didn't think such a
noopt
should do a difference, but it did.I'm doing an evaluation, I will only merge if that turns out OK.