msgraph-sdk-python
msgraph-sdk-python copied to clipboard
The first request is very slow
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)
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.