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

MSAL can consider using lazy import for request, jwt #423

Closed
jiasli opened this issue Oct 19, 2021 · 1 comment · Fixed by #454
Closed

MSAL can consider using lazy import for request, jwt #423

jiasli opened this issue Oct 19, 2021 · 1 comment · Fixed by #454

Comments

@jiasli
Copy link
Contributor

jiasli commented Oct 19, 2021

Describe the bug

Importing MSAL is can cost ~300ms on Windows due to some heavy libraries like request and jwt:

python -X importtime -c "import msal"  2>perf.log; tuna .\perf.log

image

MSAL can consider using lazy import for these libraries so that importing MSAL can be lightweight. (Azure CLI lazily imports MSAL: Azure/azure-cli#19898)

@rayluo
Copy link
Collaborator

rayluo commented Jan 21, 2022

@jiasli , your screenshot indicated that the requests and jwt combined for 2/3 of the msal import time. The PR above is able to remove those 2 parts from the tuna chart, however the overall import time was only cut short by 1/3, rather than 2/3. Still better than the current situation. :-/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants