-
Notifications
You must be signed in to change notification settings - Fork 1.7k
C++: Fix expensive getWideCharType(). #8479
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
DCA results:
Conclusion: running DCA again. |
That's without a doubt the variables-without-types issue. Nothing in this PR should be able to cause query changes, and this is the exact kind of spurious result change that this issue is causing. I think we should disable the
Did you start the DCA run with the |
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.
In any case, the change LGTM! Feel free to merge it once the DCA results come back.
Hm. On second thought. Isn't this just a case of bad magic? Would |
Sounds good to me. We're at the point where we have a good number of projects on there, but too many spurious results mostly from the same suspects.
Thanks, I didn't realize that was necessary!
I'll try it now. |
Assuming you mean on the |
Sorry. I mean on |
Done - with that change |
DCA:
|
Local testing: running @MathiasVP I'm not confident of my interpretation of the "Join order badness" on the DCA run (the latest one I ran on this PR). In the original run |
I think your interpretation is correct, yes. I'm happy with this PR as soon as it's autoformatted 👍. I'm kinda confused why there are three tables in the summary view. But that's not blocking this PR at all. The tuple counts look convincing enough to merge this, and I'm happy DCA helped us spot this! |
Ah, I hadn't seen the format test failure. Fixing that now... |
Done. |
Fix a potential issue with
FormattingFunction::getWideCharType
that was identified in the 'Join-order badness' section of a nightly DCA run. The goals here is to fix the potential issue - I have not found or looked for projects where this problem blows up enough to cause a significant overall slowdown in practice.The issue appears to come from
getAFormatterWideTypeOrDefault
, specificallynot exists(getAFormatterWideType())
within that which creates a surprising amount of computation.Before (
wireshark
,NoSpaceForZeroTerminator.ql
):After (
wireshark
,NoSpaceForZeroTerminator.ql
):I saw similar results on
vim
, and in some brief tests using other queries. I'll also start a DCA run on this PR shortly, and we'll see what the 'Join-order badness' section says now.