Reduce AssemblyName allocations#2676
Merged
cdmihai merged 9 commits intodotnet:vs15.5from Nov 6, 2017
Merged
Conversation
This reduces 1% of Roslyn rebuild allocations, and ~4% of dotnet new mvc allocations. It is safe to remove the call to clone, because PartialAssemblyName also clones it.
Otherwise it leads to wasted time when analyzing memory perf.
davkean
reviewed
Oct 27, 2017
| } | ||
|
|
||
| return true; | ||
| return a?.CultureInfo?.LCID == b?.CultureInfo?.LCID; |
Member
There was a problem hiding this comment.
This isn't the same comparison as before - if one is Invariant and one is null, this used to return true, now it returns false.
Contributor
Author
There was a problem hiding this comment.
You're right. I made the .net core implementation follow the full framework one and not the other way around
Since the full framework comparison was there first, it's the "more correct" one relative to the rest of the code.
Contributor
Author
|
Apparently |
Full framework code always returns the path to dotnet.exe
| #endif | ||
|
|
||
| [Fact] | ||
| public void ShouldBeRunningInTests() |
Contributor
There was a problem hiding this comment.
Contributor
Author
There was a problem hiding this comment.
Best kind of bugfix. :)
AndyGerlicher
approved these changes
Oct 31, 2017
Member
|
Can we get this merged in? |
Contributor
|
Will submit this plus the others on Monday for escrow. |
AndyGerlicher
approved these changes
Nov 6, 2017
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.
In mvc rebuild (133mb total allocations), reduces AssemblyName allocations 18.3% -> 0.5% and AssemblyNameExtensions 4.5% -> 0.3%. In a Roslyn rebuild (3.2gb total allocations), it reduces AssemblyName 2.3% -> 0.2% and AsssemblyNameExtension 0.6% -> 0.1%.
Commit #1 is safe to do, because the AssemblyName was double cloned ...
Commit #2 replaces calls to AssemblyNameExtension.EqualsImpl and AssemblyNameExtension.CompareBaseNameToImpl with a simple name, culture, and key comparison. This looks safe to do because:
asStringnull