Skip to content

Merge master to features/interpolated-string-constants#45924

Merged
358 commits merged intofeatures/interpolated-string-constantsfrom
merges/master-to-features/interpolated-string-constants
Jul 15, 2020
Merged

Merge master to features/interpolated-string-constants#45924
358 commits merged intofeatures/interpolated-string-constantsfrom
merges/master-to-features/interpolated-string-constants

Conversation

@dotnet-bot
Copy link
Collaborator

This is an automatically generated pull request from master into features/interpolated-string-constants.

git fetch --all
git checkout merges/master-to-features/interpolated-string-constants
git reset --hard upstream/features/interpolated-string-constants
git merge upstream/master
# Fix merge conflicts
git commit
git push upstream merges/master-to-features/interpolated-string-constants --force

Once all conflicts are resolved and all the tests pass, you are free to merge the pull request.

sharwell and others added 30 commits June 12, 2020 12:33
…c-lambdas

Merge master to features/static-lambdas
…c-lambdas

Merge master to features/static-lambdas
…c-lambdas

Merge master to features/static-lambdas
…c-lambdas

Merge master to features/static-lambdas
…c-lambdas

Merge master to features/static-lambdas
…c-lambdas

Merge master to features/static-lambdas
…c-lambdas

Merge master to features/static-lambdas
Before rewriting the statement, it now checks to see if the Switch expression is being implicitly converted. If so, it explicitly casts the expression to mach the label constant and then rewrites. If not, it rewrites as before.
This will now explicitly cast the switch expression to its converted type every time. If the cast is not needed then the Simplifier will remove the cast.

The cast is now made in the ConvertSwitchStatementToExpressionCodeFixProvider.Rewriter.cs rather than ConvertSwitchStatementToExpressionCodeFixProvider.cs
…c-lambdas

Merge master to features/static-lambdas
Now the ConvertSwitchStatementToExpressionCodeFixProvider.Rewriter.cs applies an explicit cast when it is applicable
1. Avoid creating and querying dictionaries from analyzers to actions. Instead maintain a tuple of (analyzer, actions) and special case IDE partial analysis scope to skip analyzers not in analysis scope.
2. Cache grouped analyzer actions for per-symbol actions registered within SymbolStart actions instead of re-computing them for every member symbol.

Benchmark: https://github.com/dotnet/roslyn/blob/master/docs/wiki/Measuring-Compiler-Performance.md

Default benchmark:
|                      Method |    Mean |   Error |  StdDev |  Median |     Min |     Max |       Gen 0 |      Gen 1 |     Gen 2 | Allocated |
|---------------------------- |--------:|--------:|--------:|--------:|--------:|--------:|------------:|-----------:|----------:|----------:|
| GetDiagnosticsWithAnalyzers | 14.79 s | 0.147 s | 0.304 s | 14.87 s | 14.17 s | 15.45 s | 218000.0000 | 64000.0000 | 3000.0000 |   1.28 GB |

Default benchmark + one SymbolStart analyzer:
|                      Method |    Mean |   Error |  StdDev |  Median |     Min |     Max |       Gen 0 |      Gen 1 |     Gen 2 | Allocated |
|---------------------------- |--------:|--------:|--------:|--------:|--------:|--------:|------------:|-----------:|----------:|----------:|
| GetDiagnosticsWithAnalyzers | 16.96 s | 0.079 s | 0.088 s | 16.95 s | 16.85 s | 17.14 s | 225000.0000 | 66000.0000 | 2000.0000 |   1.32 GB |

Default benchmark:
|                      Method |    Mean |   Error |  StdDev |  Median |     Min |     Max |       Gen 0 |      Gen 1 |     Gen 2 | Allocated |
|---------------------------- |--------:|--------:|--------:|--------:|--------:|--------:|------------:|-----------:|----------:|----------:|
| GetDiagnosticsWithAnalyzers | 12.76 s | 0.077 s | 0.085 s | 12.75 s | 12.62 s | 12.92 s | 218000.0000 | 60000.0000 | 2000.0000 |   1.28 GB |

Default benchmark + one SymbolStart analyzer:
|                      Method |    Mean |   Error |  StdDev |  Median |     Min |     Max |       Gen 0 |      Gen 1 |     Gen 2 | Allocated |
|---------------------------- |--------:|--------:|--------:|--------:|--------:|--------:|------------:|-----------:|----------:|----------:|
| GetDiagnosticsWithAnalyzers | 14.87 s | 0.121 s | 0.101 s | 14.90 s | 14.72 s | 15.08 s | 220000.0000 | 65000.0000 | 2000.0000 |   1.29 GB |

1. **Microsoft.CodeAnalysis.CSharp.csproj**: `msbuild /v:m /m /t:rebuild /p:UseRoslynAnalyzers=true`: Improvement from _~60 seconds_ to _~51 seconds_
2. **RoslynAnalyzers.sln**:  Improvement from _~55 seconds_ to _~48 seconds_
AnalyzerDriver performance improvements

1. Avoid creating and querying dictionaries from analyzers to actions. Instead maintain a tuple of (analyzer, actions) and special case IDE partial analysis scope to skip analyzers not in analysis scope.
2. Cache grouped analyzer actions for per-symbol actions registered within SymbolStart actions instead of re-computing them for every member symbol.

Benchmark: https://github.com/dotnet/roslyn/blob/master/docs/wiki/Measuring-Compiler-Performance.md

Default benchmark:
|                      Method |    Mean |   Error |  StdDev |  Median |     Min |     Max |       Gen 0 |      Gen 1 |     Gen 2 | Allocated |
|---------------------------- |--------:|--------:|--------:|--------:|--------:|--------:|------------:|-----------:|----------:|----------:|
| GetDiagnosticsWithAnalyzers | 14.79 s | 0.147 s | 0.304 s | 14.87 s | 14.17 s | 15.45 s | 218000.0000 | 64000.0000 | 3000.0000 |   1.28 GB |

Default benchmark + one SymbolStart analyzer:
|                      Method |    Mean |   Error |  StdDev |  Median |     Min |     Max |       Gen 0 |      Gen 1 |     Gen 2 | Allocated |
|---------------------------- |--------:|--------:|--------:|--------:|--------:|--------:|------------:|-----------:|----------:|----------:|
| GetDiagnosticsWithAnalyzers | 16.96 s | 0.079 s | 0.088 s | 16.95 s | 16.85 s | 17.14 s | 225000.0000 | 66000.0000 | 2000.0000 |   1.32 GB |

Default benchmark:
|                      Method |    Mean |   Error |  StdDev |  Median |     Min |     Max |       Gen 0 |      Gen 1 |     Gen 2 | Allocated |
|---------------------------- |--------:|--------:|--------:|--------:|--------:|--------:|------------:|-----------:|----------:|----------:|
| GetDiagnosticsWithAnalyzers | 12.76 s | 0.077 s | 0.085 s | 12.75 s | 12.62 s | 12.92 s | 218000.0000 | 60000.0000 | 2000.0000 |   1.28 GB |

Default benchmark + one SymbolStart analyzer:
|                      Method |    Mean |   Error |  StdDev |  Median |     Min |     Max |       Gen 0 |      Gen 1 |     Gen 2 | Allocated |
|---------------------------- |--------:|--------:|--------:|--------:|--------:|--------:|------------:|-----------:|----------:|----------:|
| GetDiagnosticsWithAnalyzers | 14.87 s | 0.121 s | 0.101 s | 14.90 s | 14.72 s | 15.08 s | 220000.0000 | 65000.0000 | 2000.0000 |   1.29 GB |

1. **Microsoft.CodeAnalysis.Workspaces.csproj**: `msbuild /v:m /m /t:rebuild /p:UseRoslynAnalyzers=true`
2. **Compilers.sln**: `msbuild /v:m /m /t:rebuild /p:UseRoslynAnalyzers=true Compilers.sln`
tmat and others added 17 commits July 9, 2020 17:59
…latest design. (#45831)

Related to #45296.

From specification:
If the record is derived from `object`, the record type includes a synthesized readonly property equivalent to a property declared as follows:
```C#
protected Type EqualityContract { get; };
```
The property is `virtual` unless the record type is `sealed`.
The property can be declared explicitly. It is an error if the explicit declaration does not match the expected signature or accessibility, or if the explicit declaration doesn't allow overiding it in a derived type and the record type is not `sealed`.

If the record type is derived from a base record type `Base`, the record type includes a synthesized readonly property equivalent to a property declared as follows:
```C#
protected override Type EqualityContract { get; };
```

The property can be declared explicitly. It is an error if the explicit declaration does not match the expected signature or accessibility, or if the explicit declaration doesn't allow overiding it in a derived type and the record type is not `sealed`. It is an error if either synthesized, or explicitly declared property doesn't override a property with this signature in the record type `Base` (for example, if the property is missing in the `Base`, or sealed, or not virtual, etc.).
The synthesized property returns `typeof(R)` where `R` is the record type.
Remove trailing commas during conversion to class
[Dogfooding] Extend existing IDE code style enforcement rules to EditorFeatures layer
Fix VB case correction for named tuple identifiers
* Use TestHost consistently

* Comments

* Fix

* RenameTestHost

* Renaming
Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

Auto-approval

…ter-to-features/interpolated-string-constants
@ghost ghost merged commit b9bce65 into features/interpolated-string-constants Jul 15, 2020
@ghost ghost deleted the merges/master-to-features/interpolated-string-constants branch July 15, 2020 01:16
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.