Skip to content

[release/11.0] Improve PemEncoding.TryFind perf with degenerate inputs - #133249

Merged
artl93 merged 1 commit into
release/11.0from
backport/pr-133137-to-release/11.0
Sep 5, 2026
Merged

[release/11.0] Improve PemEncoding.TryFind perf with degenerate inputs#133249
artl93 merged 1 commit into
release/11.0from
backport/pr-133137-to-release/11.0

Conversation

@github-actions

@github-actions github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Backport of #133137 to release/11.0

/cc @bartonjs

Customer Impact

  • Customer reported
  • Found internally

When TryFind is given degenerate input, it wastes a lot of CPU time realizing that "-----" is not valid Base64.

Regression

  • Yes
  • No

Testing

Existing tests say that the new algorithm does not regress functionality, and the new test shows that degenerate inputs are handled well over 10x faster.

Risk

Low, due to test coverage.

Rather than seeking for the correct PostEB, just ask if the next hyphen
is the PostEB. If not, we can bypass the IsValidBase64 checks.
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).
13 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @bartonjs, @vcsjones, @dotnet/area-system-security
See info in area-owners.md if you want to be subscribed.

@artl93 artl93 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Approved.

@artl93 artl93 added the Servicing-approved Approved for servicing release label Sep 5, 2026
@artl93

artl93 commented Sep 5, 2026

Copy link
Copy Markdown
Member

@bartonjs or @vcsjones - can you check build analysis?

@PranavSenthilnathan

Copy link
Copy Markdown
Member

/ba-g known test errors #131990 #133012

@artl93
artl93 merged commit 459f6b6 into release/11.0 Sep 5, 2026
88 of 91 checks passed
@artl93
artl93 deleted the backport/pr-133137-to-release/11.0 branch September 5, 2026 02:12
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 11.0-rc2 milestone Sep 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-System.Security Servicing-approved Approved for servicing release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants