C++: Fix expensive getWideCharType().#8479
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 |
MathiasVP
left a comment
There was a problem hiding this comment.
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::getWideCharTypethat 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.