microsoftgraph / microsoftgraph/msgraph-sdk-python

The first request is very slow

未關閉
#909 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

status:needs-discussion
主要語言
Python
星號
630
分支
96
平均合併
15 小時 20 分鐘
30 天內合併 PR
3

描述

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)

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

未指定 repository 檔案或測試。使用所示的 Python 匯入和 GraphServiceClient 呼叫順序重現此問題,然後比較第一次和第二次 await client.me.get() 呼叫。完成的標準是找出並處理第一次要求額外延遲的原因,並透過回歸檢查驗證行為。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
azure, python
領域
api, performance
Issue 類型
缺陷
難度
4/5
預估耗時
3-5 天
活躍度
停滯
描述清晰度
需要釐清
新手友好度
30/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。