Skip to content
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

Perf: Investigate optimizations around AcquireTokenSilentSupplier.getAuthorityWithPrefNetworkHost #897

Open
billwert opened this issue Jan 9, 2025 · 0 comments
Labels
confidential-client For issues related to confidential client apps Enhancement A request or suggestion to improve some aspect of the library public-client For questions/issues related to public client apps

Comments

@billwert
Copy link

billwert commented Jan 9, 2025

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.

@Avery-Dunn Avery-Dunn added Enhancement A request or suggestion to improve some aspect of the library confidential-client For issues related to confidential client apps public-client For questions/issues related to public client apps labels Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confidential-client For issues related to confidential client apps Enhancement A request or suggestion to improve some aspect of the library public-client For questions/issues related to public client apps
Projects
None yet
Development

No branches or pull requests

2 participants