Fix problems associated with analyzer timing#24564
Merged
sharwell merged 3 commits intodotnet:dev15.6.xfrom Feb 2, 2018
Merged
Fix problems associated with analyzer timing#24564sharwell merged 3 commits intodotnet:dev15.6.xfrom
sharwell merged 3 commits intodotnet:dev15.6.xfrom
Conversation
mavasani
approved these changes
Jan 31, 2018
heejaechang
approved these changes
Jan 31, 2018
jasonmalinowski
approved these changes
Feb 1, 2018
Member
jasonmalinowski
left a comment
There was a problem hiding this comment.
Who would have thought timing is so hard. Nice find!
| private readonly Func<Diagnostic, DiagnosticAnalyzer, Compilation, CancellationToken, bool> _shouldSuppressGeneratedCodeDiagnostic; | ||
| private readonly Func<SyntaxTree, TextSpan, bool> _isGeneratedCodeLocation; | ||
| private readonly ConcurrentDictionary<DiagnosticAnalyzer, TimeSpan> _analyzerExecutionTimeMapOpt; | ||
| private readonly ConcurrentDictionary<DiagnosticAnalyzer, StrongBox<long>> _analyzerExecutionTimeMapOpt; |
Member
There was a problem hiding this comment.
Nit: add a comment to say what unit this is in now that we've lost the TimeSpan. (I normally hate any non-TimeSpan but obviously in this case you're doing it for a Good Reason™.)
Contributor
Author
There was a problem hiding this comment.
I normally hate any non-TimeSpan...
Me too.
Contributor
|
Approved to merge via Link |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Customer scenario
A customer runs the compiler with analyzer timing enabled (either through the API or with a compiler flag on the command line). The timing operations incur substantial overhead on concurrent builds, and when one or more analyzers allocates large amounts of data, the timing results are inaccurate.
Bugs this fixes
DevDiv 560657 (internal mirror of this pull request)
Workarounds, if any
Risk
Low.
Performance impact
Performance for intense analyzer scenarios can be improved by 20%. In addition, timing error rates of over 150% were observed for some analyzers.
Is this a regression from a previous update?
No, but the work to reduce overhead in this scenario revealed another problem at the same location. This bug is limiting our ability to observe the expected gains from previous work.
Root cause analysis
The previous work in this area was focused on allocation reductions (#23582), which were achieved as expected by #23621. The problem corrected by this pull request is a CPU time problem revealed by profiling execution times (#23583).
How was the bug found?
Profiling per #23583.
Test documentation updated?
N/A