Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[release/8.0.1xx] Add analyzer/fixer to suggest using cached SearchValues instances#6924

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
buyaa-n merged 27 commits intorelease/8.0.1xxfrombackport/pr-6898-to-release/8.0.1xx
Sep 8, 2023

Conversation

@github-actions
Copy link

@github-actionsgithub-actionsbot commentedSep 8, 2023
edited by buyaa-n
Loading

Backport of#6898 to release/8.0.1xx

/cc@MihaZupan

Customer Impact

SearchValues is a new .NET 8 feature, and it'd be very nice to have a better end-to-end story for the release by having the analyzer/fixer shipping together with the library support it targets.

The main benefit is giving users an easy way to boost searching performance by doing the code rewriting for them, as well as raising their awareness of the new feature's existence.

Through telemetry, we know that many of the patterns flagged by this analyzer (e.g.IndexOfAny(new[] { ... }) orreadonly char[] _myField = ...;) are quite often used by users of these APIs.

Testing

Decent code coverage was added as part of this PR.
Running the analyzer against dotnet/runtime flagged only 3 places that we haven't updated manually yet in projects that multi-target older TFMs. It hit no false positives.

Risk

It's another analyzer users may have to disable/adjust code fixes for in projects that also target older TFMs where theSearchValues API is not available.

@codecov
Copy link

codecovbot commentedSep 8, 2023

Codecov Report

Merging#6924 (4aa64c3) intorelease/8.0.1xx (e2e6382) willdecrease coverage by0.01%.
The diff coverage is95.53%.

@@                 Coverage Diff                 @@##           release/8.0.1xx    #6924      +/-   ##===================================================- Coverage            96.40%   96.39%   -0.01%===================================================  Files                 1396     1402       +6       Lines               330339   331860    +1521       Branches             10882    11027     +145     ===================================================+ Hits                318453   319912    +1459- Misses                9159     9186      +27- Partials              2727     2762      +35

@MihaZupan
Copy link
Member

MihaZupan commentedSep 8, 2023
edited
Loading

(I'm lacking perms to edit the above comment)

Customer Impact

SearchValues is a new .NET 8 feature, and it'd be very nice to have a better end-to-end story for the release by having the analyzer/fixer shipping together with the library support it targets.

The main benefit is giving users an easy way to boost searching performance by doing the code rewriting for them, as well as raising their awareness of the new feature's existence.

Through telemetry, we know that many of the patterns flagged by this analyzer (e.g.IndexOfAny(new[] { ... }) orreadonly char[] _myField = ...;) are quite often used by users of these APIs.

Testing

Decent code coverage was added as part of this PR.
Running the analyzer against dotnet/runtime flagged only 3 places that we haven't updated manually yet in projects that multi-target older TFMs. It hit no false positives.

Risk

It's another analyzer users may have to disable/adjust code fixes for in projects that also target older TFMs where theSearchValues API is not available.

buyaa-n reacted with thumbs up emoji

@buyaa-n
Copy link

(I'm lacking perms to edit the above comment)

Thanks, updated the description

MihaZupan reacted with thumbs up emoji

@jeffhandley
Copy link
Member

It hit no false negatives

Did you mean "false positives" here by chance? As in, a positive match for where the analyzer would raise a diagnostic, but it was an erroneous diagnostic?

buyaa-n reacted with thumbs up emoji

@MihaZupan
Copy link
Member

Oops, yes, should be false positives.

Copy link
Member

@jeffhandleyjeffhandley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This has my support for .NET 8 RC2. The analyzer guides users to adopt the new net8SearchValues API to improve performance of their existing code, completing the end-to-end experience for this new API.

The analyzer is Info-level by default, which means it can be introduced in a non-breaking way.

We should enable the analyzer inmain for aspnetcore, efcore, and perhaps other dotnet org repos where it's likely the older APIs are being used.

Tagging@artl93 for RC2 consideration.

@artl93
Copy link
Member

M2 approved. Thanks!

@buyaa-nbuyaa-n merged commit249601b intorelease/8.0.1xxSep 8, 2023
@buyaa-nbuyaa-n deleted the backport/pr-6898-to-release/8.0.1xx branchSeptember 8, 2023 22:32
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@jeffhandleyjeffhandleyjeffhandley approved these changes

@stephentoubstephentoubAwaiting requested review from stephentoub

@mavasanimavasaniAwaiting requested review from mavasani

+2 more reviewers

@artl93artl93artl93 approved these changes

@buyaa-nbuyaa-nbuyaa-n approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

8.0.1xx

Development

Successfully merging this pull request may close these issues.

5 participants

@MihaZupan@buyaa-n@jeffhandley@artl93

[8]ページ先頭

©2009-2025 Movatter.jp