Adding N annotations takes O(N^2) time
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 新手友好度
- 35/100
- Issue 類型
- 缺陷
- 描述清晰度
- 需要釐清
- 活躍度
- 停滯
- 技術堆疊
- python
研究方向
首先執行 issue 中的重現腳本,並對重複呼叫 fig.add_annotation 進行效能分析。追蹤 Python Figure 的註解路徑,以找出累積成本增加的位置,然後使用相同的 script 驗證新增大量註解不再呈現二次行為。
由索引模型根據 Issue 內容生成。
描述
Plotly is unreasonably slow to add more than a few hundred annotations to a plot. This code
import time
import plotly
fig = plotly.graph_objects.Figure()
NUM_ANNOTATIONS=1000
start_time = time.monotonic()
for i in range(NUM_ANNOTATIONS):
fig.add_annotation(
x=i,
y=time.monotonic() - start_time,
text=str(i),
)
print(i)
fig.update_layout(
xaxis_range=[0,NUM_ANNOTATIONS],
yaxis_range=[0,time.monotonic() - start_time],
xaxis_title_text="# Annotations",
yaxis_title_text="Cumulative Time [s]",
)
fig.show()
produces this plot
- 主要語言
- Python
- 星號
- 18.8k
- 分支
- 2.8k
- 平均合併
- 13 小時 28 分鐘
- 30 天內合併 PR
- 20
環境準備
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
plotly/plotly.py 的其他 Issue
-
P3 size: 1 task
難度 2/5 1-3 小時 新手友好度 65/100
plotly/plotly.py#5769 · 1 個 reaction ·
維護者通常 1 天內回覆
-
P3 size: 1 task
難度 2/5 1-3 小時 新手友好度 72/100
維護者通常 1 天內回覆
-
bug P1
難度 1/5 1 小時以內 新手友好度 68/100
維護者通常 1 天內回覆
-
feature P3
難度 2/5 1-3 小時 新手友好度 62/100
維護者通常 1 天內回覆
-
feature P3
難度 2/5 1-3 小時 新手友好度 72/100
plotly/plotly.py#3859 · 1 則留言 ·
維護者通常 1 天內回覆
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 74/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 84/100
gradio-app/gradio#13895 ·
維護者通常 1 天內回覆
-
build-error
難度 2/5 1-3 小時 新手友好度 76/100
spack/spack-packages#6713 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 72/100
ActivityWatch/activitywatch#1464 · 1 個 reaction ·
維護者通常 1 天內回覆
-
[Bug]: The ckg tool drops the return type of every decorated Python method in class search results未關閉
難度 2/5 1-3 小時 新手友好度 78/100
bytedance/trae-agent#483 ·
維護者通常 1 天內回覆