Skip to content

Merge main to main-vs-deps#52187

Merged
18 commits merged intomain-vs-depsfrom
merges/main-to-main-vs-deps
Mar 28, 2021
Merged

Merge main to main-vs-deps#52187
18 commits merged intomain-vs-depsfrom
merges/main-to-main-vs-deps

Conversation

@dotnet-bot
Copy link
Collaborator

This is an automatically generated pull request from main into main-vs-deps.

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

Troubleshooting conflicts

Identify authors of changes which introduced merge conflicts

Scroll to the bottom, then for each file containing conflicts copy its path into the following searches:

Usually the most recent change to a file between the two branches is considered to have introduced the conflicts, but sometimes it will be necessary to look for the conflicting lines and check the blame in each branch. Generally the author whose change introduced the conflicts should pull down this PR, fix the conflicts locally, then push up a commit resolving the conflicts.

Resolve merge conflicts using your local repo

Sometimes merge conflicts may be present on GitHub but merging locally will work without conflicts. This is due to differences between the merge algorithm used in local git versus the one used by GitHub.

git fetch --all
git checkout merges/main-to-main-vs-deps
git reset --hard upstream/main-vs-deps
git merge upstream/main
# Fix merge conflicts
git commit
git push upstream merges/main-to-main-vs-deps --force

N. Taylor Mullen and others added 18 commits March 24, 2021 14:13
- We used to cache displayText, text document, position and completion triggers on the data field of a completion item however in practice this resulted in having a pretty massive footprint on how completion lists serialized/deserialized.
  - Because completion resolve used to cache more data and now we don't I added a telemetry event to capture how often a cache miss actually happens
  - As part of this I had to migrate the `CompletionListCache` to be synchronous so that we can synchronously resolve cache entries at completion resolve time.
- Updated tests to reflect new resolve behavior. As part of doing this I had to expand the completion resolve tests to actually generate completion lists so caches were properly updated. Ultimately this more accurately reflects what happens in real scenarios.
- Wanted to use records so added an `IsExternalInit.cs` file to enable record usage in netstandard2.0.

## Benchmark results

**Scenario:** Typing `@` in a Razor file and getting a basic C# completion list.

Optimized = true represents utilizing the Optimized completion list (which Roslyn does now) and unoptimized represents anyone who's consuming Roslyn's completion list who doesn't use the optimized completion list structure.

### Before (817KB)
|                                                    Method | Optimized |      Mean |     Error |    StdDev |   Op/s |     Gen 0 |    Gen 1 |    Gen 2 | Allocated |
|---------------------------------------------------------- |---------- |----------:|----------:|----------:|-------:|----------:|---------:|---------:|----------:|
| 'Completion List Roundtrip Serialization/Deserialization' |     False | 29.301 ms | 0.5816 ms | 0.6698 ms |  34.13 | 1718.7500 | 937.5000 | 250.0000 |    9.8 MB |
|                           'Completion List Serialization' |     False | 10.223 ms | 0.1926 ms | 0.1608 ms |  97.82 |  625.0000 | 250.0000 | 234.3750 |   3.27 MB |
|                         'Completion List Deserialization' |     False | 18.653 ms | 0.3708 ms | 0.5882 ms |  53.61 | 1062.5000 | 531.2500 |        - |   6.52 MB |
| 'Completion List Roundtrip Serialization/Deserialization' |      True | 19.509 ms | 0.3308 ms | 0.3094 ms |  51.26 | 1218.7500 | 718.7500 | 218.7500 |   7.03 MB |
|                           'Completion List Serialization' |      True |  2.121 ms | 0.0259 ms | 0.0216 ms | 471.46 |  199.2188 | 167.9688 | 164.0625 |    1.1 MB |
|                         'Completion List Deserialization' |      True | 18.869 ms | 0.3342 ms | 0.3849 ms |  53.00 | 1062.5000 | 531.2500 |        - |   6.52 MB |

### After (458KB)
|                                                    Method | Optimized |      Mean |     Error |    StdDev |   Op/s |     Gen 0 |    Gen 1 |    Gen 2 |  Allocated |
|---------------------------------------------------------- |---------- |----------:|----------:|----------:|-------:|----------:|---------:|---------:|-----------:|
| 'Completion List Roundtrip Serialization/Deserialization' |     False | 19.438 ms | 0.3835 ms | 0.3400 ms |  51.45 | 1093.7500 | 406.2500 | 125.0000 | 7216.06 KB |
|                           'Completion List Serialization' |     False |  8.355 ms | 0.0735 ms | 0.0651 ms | 119.68 |  437.5000 | 171.8750 | 125.0000 | 2839.71 KB |
|                         'Completion List Deserialization' |     False | 10.303 ms | 0.2045 ms | 0.5701 ms |  97.06 |  625.0000 | 312.5000 |        - | 3844.78 KB |
| 'Completion List Roundtrip Serialization/Deserialization' |      True | 10.847 ms | 0.2057 ms | 0.2021 ms |  92.20 |  656.2500 | 234.3750 | 109.3750 | 4458.84 KB |
|                           'Completion List Serialization' |      True |  1.163 ms | 0.0064 ms | 0.0060 ms | 860.16 |  123.0469 | 123.0469 | 123.0469 |  614.06 KB |
|                         'Completion List Deserialization' |      True | 10.103 ms | 0.2004 ms | 0.3909 ms |  98.98 |  625.0000 | 312.5000 |        - | 3844.78 KB |

### Results (Optimized = true)

**Roundtrip Improvement:** 1.8x
**Serialization Improvement:** 1.82x
**Deserialization Improvement:** 1.87x

Part of dotnet/aspnetcore#30232
…tionResolveData.cs

Co-authored-by: David Barbet <dabarbet@microsoft.com>
Changed LSP completion resolve to not cache data on items.
Show static members of matching types in completion
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

@ghost ghost merged commit 3237694 into main-vs-deps Mar 28, 2021
@ghost ghost deleted the merges/main-to-main-vs-deps branch March 28, 2021 20:29
@ghost ghost added this to the Next milestone Mar 28, 2021
@allisonchou allisonchou modified the milestones: Next, 16.10.P2 Mar 29, 2021
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.

8 participants