-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Removing unnecessary comments #114190
Removing unnecessary comments #114190
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR removes extraneous commentary from method implementations in the IncreaseMetadataRowSize test file based on previous feedback.
- Removed placeholder comments from Method2, Method3, Method4, and Method5
- Simplified each method to an empty implementation
Looks like this has another whitespace conflict? |
{ | ||
return 0; | ||
} | ||
public static void Method2(int x2) {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public static void Method2(int x2) {} | |
public static void Method2() {} |
Do these methods even need the arguments?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, to increase the string heap on metadata I preferred to add a parameter on each method than adding the double number of the methods.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, ok. I thought that the test is trying to go over some threshold limit related to number of methods (ie methoddef tokens) given that it has very large number of methods.
It sounds like the test is actually trying to get over the 64k limit for the string blob size. Is that right? It would be useful to mention in a comment somewhere. It is not obvious from the test code.
Also, I assume that the number of methods can be much smaller if we just gave them longer names, like void VeryLooooooooooooooooooooooooooooooooongMethodNameToPushTheStringBlobOver64k_1() { }
, void VeryLooooooooooooooooooooooooooooooooongMethodNameToPushTheStringBlobOver64k_2() { }
, ... - we would only need less than 1000 of those. Is that right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, I did that now. Thanks!
Fixed. |
# global autocrlf
$ git config --global core.autocrlf
# is empty
# system autocrlf
$ git config --system core.autocrlf
# is true If you want to match this config, then from admin shell: |
I have already done it, but how did you see that it's wrong yet, for me I see this output when I call:
|
Ah, I was actually inspecting the patch link https://patch-diff.githubusercontent.com/raw/dotnet/runtime/pull/114190.patch, it shows diffs commit-wise rather than composite diff. Your latest commit indeed fixed the issue. 👍 |
Tagging subscribers to this area: @dotnet/area-system-reflection-metadata |
[like] Noah Falk reacted to your message:
…________________________________
From: Thays Grazia ***@***.***>
Sent: Thursday, April 3, 2025 3:45:34 PM
To: dotnet/runtime ***@***.***>
Cc: Noah Falk ***@***.***>; Review requested ***@***.***>
Subject: Re: [dotnet/runtime] Removing unnecessary comments (PR #114190)
Fixed.
_v1 still has the incorrect line endings. You probably want to set core.autocrlf to true on your machine: https://git-scm.com/book/en/v2/Customizing-Git-Git-Configuration#_core_autocrlf. On my windows box (standard install VS and git-for-windows):
# global autocrlf
$ git config --global core.autocrlf
# is empty
# system autocrlf
$ git config --system core.autocrlf
# is true
If you want to match this config, then from admin shell: git config --system core.autocrlf true. Otherwise, you can set it globally for your user profile git config --global core.autocrlf true without admin command prompt or powershell.
I have already done it, but how did you see that it's wrong yet, for me I see this output when I call:
git ls-files --eol
i/lf w/crlf attr/text src/libraries/System.Runtime.Loader/tests/ApplyUpdate/System.Reflection.Metadata.ApplyUpdate.Test.IncreaseMetadataRowSize/IncreaseMetadataRowSize.cs
i/lf w/crlf attr/text src/libraries/System.Runtime.Loader/tests/ApplyUpdate/System.Reflection.Metadata.ApplyUpdate.Test.IncreaseMetadataRowSize/IncreaseMetadataRowSize_v1.cs
i/lf w/crlf attr/text src/libraries/System.Runtime.Loader/tests/ApplyUpdate/System.Reflection.Metadata.ApplyUpdate.Test.IncreaseMetadataRowSize/System.Reflection.Metadata.ApplyUpdate.Test.IncreaseMetadataRowSize.csproj
i/lf w/crlf attr/text=auto src/libraries/System.Runtime.Loader/tests/ApplyUpdate/System.Reflection.Metadata.ApplyUpdate.Test.IncreaseMetadataRowSize/deltascript.json
—
Reply to this email directly, view it on GitHub<#114190 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ABPULQBYSK7LYKZEXGLUS3D2XVJR5AVCNFSM6AAAAAB2K4EHDOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDONZWGIZTINRRGM>.
You are receiving this because your review was requested.Message ID: ***@***.***>
[thaystg]thaystg left a comment (dotnet/runtime#114190)<#114190 (comment)>
Fixed.
_v1 still has the incorrect line endings. You probably want to set core.autocrlf to true on your machine: https://git-scm.com/book/en/v2/Customizing-Git-Git-Configuration#_core_autocrlf. On my windows box (standard install VS and git-for-windows):
# global autocrlf
$ git config --global core.autocrlf
# is empty
# system autocrlf
$ git config --system core.autocrlf
# is true
If you want to match this config, then from admin shell: git config --system core.autocrlf true. Otherwise, you can set it globally for your user profile git config --global core.autocrlf true without admin command prompt or powershell.
I have already done it, but how did you see that it's wrong yet, for me I see this output when I call:
git ls-files --eol
i/lf w/crlf attr/text src/libraries/System.Runtime.Loader/tests/ApplyUpdate/System.Reflection.Metadata.ApplyUpdate.Test.IncreaseMetadataRowSize/IncreaseMetadataRowSize.cs
i/lf w/crlf attr/text src/libraries/System.Runtime.Loader/tests/ApplyUpdate/System.Reflection.Metadata.ApplyUpdate.Test.IncreaseMetadataRowSize/IncreaseMetadataRowSize_v1.cs
i/lf w/crlf attr/text src/libraries/System.Runtime.Loader/tests/ApplyUpdate/System.Reflection.Metadata.ApplyUpdate.Test.IncreaseMetadataRowSize/System.Reflection.Metadata.ApplyUpdate.Test.IncreaseMetadataRowSize.csproj
i/lf w/crlf attr/text=auto src/libraries/System.Runtime.Loader/tests/ApplyUpdate/System.Reflection.Metadata.ApplyUpdate.Test.IncreaseMetadataRowSize/deltascript.json
—
Reply to this email directly, view it on GitHub<#114190 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ABPULQBYSK7LYKZEXGLUS3D2XVJR5AVCNFSM6AAAAAB2K4EHDOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDONZWGIZTINRRGM>.
You are receiving this because your review was requested.Message ID: ***@***.***>
|
@@ -9,30 +9,10 @@ public static int Method1() | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please add license headers?
Also, "This file was autogenerated by copilot." is not useful and it should be deleted. If we were adding a comment like that to all pieces of code that AI helped with, we would have them all over the place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Addressing @jkotas comment in this other PR: #113995