-
Notifications
You must be signed in to change notification settings - Fork 866
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
perf: Change existing struct to readonly struct #9119
Conversation
It's anyway boxed when it is passed as IFileLinkInfo. |
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #9119 +/- ##
=======================================
Coverage 77.58% 77.58%
=======================================
Files 591 591
Lines 24567 24567
=======================================
Hits 19060 19060
Misses 5507 5507
☔ View full report in Codecov by Sentry. |
|
There is another docfx/test/Docfx.Build.Common.Tests/FileLinkInfoTest.cs Lines 31 to 33 in d4b18eb
It might to be better to change |
Co-authored-by: Yufei Huang <[email protected]>
What's included in this PR
struct
model toreadonly struct
.This change ensure model is not modified after created.
And It can reduce object copy when passing struct as argument. and
defensive copy
of struct object.(Thought It's not measurable perf improvement.)