Skip to content

Perf: Investigate optimizations around AcquireTokenSilentSupplier.getAuthorityWithPrefNetworkHost #897

Open

Description

@billwert

While doing some perf investigations on Azure Identity I noticed that we spend a ton of time in getAuthorityWithPrefNetworkHost when getting tokens out of the cache. The perf test is literally calling acquireTokenForManagedIdentity in a hot loop with no parameters or authority configured.

It ends up being ~70% of the time under AcquireSilentTokenSupplier.execute():

image
image

Discussion with Avery-Dunn offline leads to the thought that we can optimize this path some - there's no reason to recompute and reconstruct an authority every call.

This should be investigated in the silent, device code, and auth grant flows.

Activity

  1. added
    EnhancementA request or suggestion to improve some aspect of the library
    confidential-clientFor issues related to confidential client apps
    public-clientFor questions/issues related to public client apps
    on Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    EnhancementA request or suggestion to improve some aspect of the libraryconfidential-clientFor issues related to confidential client appspublic-clientFor questions/issues related to public client apps

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions