microsoftgraph / microsoftgraph/msgraph-sdk-python

The first request is very slow

Open
#909 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status:needs-discussion
Dominant language
Python
Stars
630
Forks
96
Avg merge
15h 20m
Merged PRs (30d)
3

Description

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)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No repository file or test is named. Reproduce the issue using the Python imports and GraphServiceClient sequence shown, then compare the first and second await client.me.get() calls. Done means identifying and addressing the cause of the extra first-request latency and verifying the behavior with a regression check.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, python
Domain
api, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.