-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Deoptimize the exceptional cases in favor of optimal path #62997
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
Conversation
/azp run |
Azure Pipelines successfully started running 4 pipeline(s). |
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 optimizes the state persistence flow by eliminating redundant dictionary lookups in the success path. Instead of checking for key existence with ContainsKey
followed by Add
, it directly uses TryAdd
which atomically checks and adds the key-value pair.
- Replaces the two-step
ContainsKey
+Add
pattern with singleTryAdd
operations - Reduces dictionary lookups from two to one in the success path
- Maintains the same exception behavior for duplicate keys
/azp run aspnetcore-always-green |
Azure Pipelines could not run because the pipeline triggers exclude this branch/path. |
/ba-g failure is not from recent build |
Avoid an extra lookup in the fastpath at the expense of potentially a lot of work