Update ref performance article(s) for C# 11#32997
Merged
BillWagner merged 20 commits intodotnet:mainfrom Feb 7, 2023
Merged
Conversation
716923e to
a250604
Compare
4901fb6 to
95e1eea
Compare
95e1eea to
432792d
Compare
caee42b to
89c0007
Compare
4c5805d to
c83a522
Compare
- Add a new top level node for "Advanced topics". Under that node are the Roslyn SDK and the new performance node. - Move existing topic. - Add redirects - Add new outline fix current build warnings
Making these edits first will make it easier to chop this up and reorganize without losing the context in these issues.
Ignore the old-stuff.md file. That's a checkpoint so I don't lose any text until it's converted
c83a522 to
6db7911
Compare
BillWagner
added a commit
to BillWagner/samples
that referenced
this pull request
Jan 23, 2023
This sample has the starter app and finished application for the tutorial added in dotnet/docs#32997 The tutorial shows the reader how to analyze when your application is allocating memory unnecessarily, and how you can use the profiler tools and the C# language `ref` safety features to improve performance.
CamSoper
suggested changes
Jan 31, 2023
CamSoper
left a comment
There was a problem hiding this comment.
In the tutorial, my program had unexpected output. Lot's of values were 0 or NaN. Totally willing to believe I missed something in the text but I'm not seeing it.
On further review (thanks, WinMerge!) it looks like there were changes that I was supposed to make that weren't clear in Program.cs and Room.cs.
Co-authored-by: Cam Soper <cam.soper@microsoft.com>
Add steps missing from the tutorial.
Member
Author
|
Thanks @CamSoper I've addressed all the feedback. |
cston
reviewed
Feb 3, 2023
cston
reviewed
Feb 3, 2023
cston
reviewed
Feb 3, 2023
cston
reviewed
Feb 3, 2023
cston
reviewed
Feb 3, 2023
BillWagner
commented
Feb 3, 2023
Member
Author
BillWagner
left a comment
There was a problem hiding this comment.
Thanks a lot @cston This is really helpful.
I addressed all the feedback. One set of changes was to rewrite a paragraph. Can you give that change in the final commit another look?
Thanks again.
cston
reviewed
Feb 6, 2023
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.



This article was originally created in the C# 7 wave. Several improvements in this area have happened since then. We've added many features around the general concept of using
refvariables and `ref assignment. Rework this article into an overview and a tutorial that cover the feature.The overview describes the the problem space and the techniques to improve performance using
structtypes and references instead of values.The tutorial starts with a program that creates numerous unnecessary allocations. Each step demonstrates one of the techniques to remove allocations, preserve the original semantics, and clarify expectations on data modification.
Fixes #32668
Several other issues related to this issue are also fixed in this PR
Fixes #27175 - Add note about
readonlymodifier on auto-implemented properties.Fixes #27199 - Include init-only properties as well for readonly.
Fixes #27201 - add note about init only properties marked as readonly.
Fixes #27202 - remove duplicate notes about ref assignment and readonly ref assignment.
Fixes #27203 - reword sentence.
Fixes #27205 - reword description, remove duplicate explanation
Fixes #27208 - clarify internal reference.
Fixes #32594 - lower the strength of the specific recommendation.