-
Notifications
You must be signed in to change notification settings - Fork 340
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
Reuse lists in token cache filtering logic. #3233
Conversation
b066d8a
to
203a144
Compare
src/client/Microsoft.Identity.Client/TokenCache.ITokenCacheInternal.cs
Outdated
Show resolved
Hide resolved
649e70e
to
c46c670
Compare
171e22f
to
ea8a897
Compare
@pmaytak - did you invert the 2 perf tables in the description? Because the "before" looks better than the "After". |
src/client/Microsoft.Identity.Client/TokenCache.ITokenCacheInternal.cs
Outdated
Show resolved
Hide resolved
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.
Please see the comment around filtering by tenantId first and then by clientid.
Yes, :) Corrected. |
src/client/Microsoft.Identity.Client/TokenCache.ITokenCacheInternal.cs
Outdated
Show resolved
Hide resolved
…library-for-dotnet * 'master' of github.com:AzureAD/microsoft-authentication-library-for-dotnet: (39 commits) OBO for SP with RT support (AzureAD#3266) (AzureAD#3280) Update some projects to net48 (AzureAD#3269) Bump Source Link version (tool change) (AzureAD#3275) Update changelog.txt (AzureAD#3282) Default to WebView1 instead of WebView2 when using AAD or ADFS authorities (AzureAD#3276) Revert "OBO for SP with RT support (AzureAD#3266)" OBO for SP with RT support (AzureAD#3266) Add perf tests for Acquire Token calls with serialization cache and Builders (AzureAD#3250) Minor fix to SuggestedCacheKey comment and update NuGet icon in Readme. (AzureAD#3268) MSAL changelog 4.43.0 (AzureAD#3263) Bogavril/3251 (AzureAD#3255) Fix for AzureAD#3248 - use the correct plugin to sing out (AzureAD#3253) Performance project improvements (AzureAD#3064) Reuse lists in token cache filtering logic. (AzureAD#3233) Update andorid install script to use andorid 30 (AzureAD#3243) Fix for UWP packaging (AzureAD#3239) Pass account to Auth result (AzureAD#3199) App ported to Lab4 (AzureAD#3229) Trwalke/ruleset updates (AzureAD#3189) Conditional Access for Android (AzureAD#3210) ...
Fixes #3178
Changes proposed in this request
IReadOnlyList
withList
in accessor and filtering methods (RemoveAll
is in concreteList
implementation).FilterWithLogging
, replacelist = list.Where(predicate).ToList();
withlist.RemoveAll(e => !predicate(e));
Where
withRemoveAll
and reverse filtering predicate (since instead of keeping the items based on a filter, we now remove items based on the opposite of that filter).Testing
Existing tests.
Performance impact
Tested with 1 tenant and 10K tokens in cache (tenants don't matter in this scenario). About 40% reduction in memory allocated for client, OBO, and silent calls. Perf improvement is minimal, only about .5 ms for silent call.
Before
After