Skip to content

{Core} Optimize performance for MSAL migration#19898

Merged
jiasli merged 2 commits intoAzure:devfrom
jiasli:perf
Oct 15, 2021
Merged

{Core} Optimize performance for MSAL migration#19898
jiasli merged 2 commits intoAzure:devfrom
jiasli:perf

Conversation

@jiasli
Copy link
Member

@jiasli jiasli commented Oct 15, 2021

Description

As authentication logic is now split from Profile, performance can be further improved by lazy loading .auth.identity module.

> Measure-Command {python -m azure.cli version}
TotalMilliseconds : 384.9338

> Measure-Command {az version}
TotalMilliseconds : 404.2362

Imported modules can be inspected with

python -X importtime -m azure.cli version 2>perf.log; tuna .\perf.log

image

@jiasli jiasli requested a review from evelyn-ys as a code owner October 15, 2021 06:04
Comment on lines 105 to 109
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can eliminate the Azure Core import time:

python -X importtime -m azure.cli account get-access-token 2>perf.log; tuna .\perf.log

image

# Before
> Measure-Command {python -m azure.cli account get-access-token}
TotalMilliseconds : 1281.14

# After
> Measure-Command {python -m azure.cli account get-access-token}
TotalMilliseconds : 1070.6358

@jiasli jiasli self-assigned this Oct 15, 2021
@jiasli jiasli added the MSAL label Oct 15, 2021
@yonzhan
Copy link
Collaborator

yonzhan commented Oct 15, 2021

performance Optimization

@jiasli jiasli requested review from calvinhzy and yonzhan October 15, 2021 06:14
@yonzhan yonzhan added this to the Oct 2021 (2021-11-02) milestone Oct 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants