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

The first request is very slow #909

Open
michaelmesser opened this issue Sep 30, 2024 · 1 comment
Open

The first request is very slow #909

michaelmesser opened this issue Sep 30, 2024 · 1 comment
Labels
status:needs-discussion An issue that requires more discussion internally before resolving

Comments

@michaelmesser
Copy link

michaelmesser commented Sep 30, 2024

Not sure if performance is a feature request or bug.

import win32gui
from azure.identity.broker import InteractiveBrowserBrokerCredential
from msgraph.graph_service_client import GraphServiceClient

1.1s (Already in issue #904)

current_window_handle = win32gui.GetForegroundWindow()
credentials = InteractiveBrowserBrokerCredential(
    tenant_id=tenant,
    client_id=client_id,
    use_default_broker_account=True,
    parent_window_handle=current_window_handle,
)

0.0s (Expected)

client = GraphServiceClient(
    credentials=credentials,
    scopes=[]
)

0.4s (Slower than I would expect)

await client.me.get()

2.2s (1st request. This is significantly slower than I would expect)

await client.me.get()

0.1s (2nd request. Expected)

@michaelmesser michaelmesser added the status:waiting-for-triage An issue that is yet to be reviewed or assigned label Sep 30, 2024
@shemogumbe shemogumbe added status:needs-discussion An issue that requires more discussion internally before resolving and removed status:waiting-for-triage An issue that is yet to be reviewed or assigned labels Oct 8, 2024
@michaelmesser
Copy link
Author

Were you able to determine why this is so slow? I think it should only be making a few requests, so I would expect it to be significantly faster.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:needs-discussion An issue that requires more discussion internally before resolving
Projects
None yet
Development

No branches or pull requests

2 participants