dash-renderer: determineChangedProps scans every layoutHashes entry for each dashChildrenUpdate component on every store update
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 48/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- javascript, react
- 領域
- frontend, performance
調査の方向性
Start in the dash-renderer implementation of selectDashProps, determineChangedProps, isFirstLevelPropsChild, and the layoutHashes state path. Reproduce the repeated scans with flagged dashChildrenUpdate components, then evaluate an indexing or per-update approach while confirming that children still update correctly and the measured rendering cost improves.
索引モデルが issue の本文から書いたものです。
説明
Versions: dash 3.4.0 (the same code is in 4.4.1), dash-mantine-components 2.5.1, Chromium.
What happens. In selectDashProps, a component whose type sets dashChildrenUpdate calls determineChangedProps(state, strPath). That function iterates Object.entries(state.layoutHashes) and calls isFirstLevelPropsChild, which does two split(',') calls per entry. It does this for every flagged component, on every Redux store update (callback responses, loading-state and request bookkeeping included). layoutHashes gains one entry per path whose props ever changed and never shrinks. So the cost is roughly O(flagged components × changed paths × store updates), and it grows the longer a tab stays open.
Why it bites. DMC sets the flag on MenuItem, MenuDropdown, MenuLabel, SubMenu*, Tooltip, FloatingTooltip, PopoverDropdown, HoverCardDropdown, Stepper and Timeline; dcc sets it on Tabs. An app with a keepMounted header menu (which callbacks inside a closed menu require) and tooltips on navbar links has dozens of flagged components mounted on every page.
Measured (production app; CPU profile via the Chrome DevTools Protocol; headless Chromium; 5 full loads per page):
- The anonymous
isFirstLevelPropsChildcomparison was the single hottest function. It took 0.84–2.07 s of main-thread time between a page's layout arriving and its content rendering. - Deleting
dashChildrenUpdatefrom the DMC menu and tooltip types before the renderer reads them made page content appear 1.5–2.2× sooner, e.g. 2.83 s → 1.54 s and 5.36 s → 2.56 s. Main-thread busy time fell 3–4×. - Children inside those components still updated correctly.
Possible fixes:
- Index
layoutHashesby parent path, so a component only looks at its own direct children. - Or compute the descendant hash once per store update rather than once per flagged component.
- Or let component libraries opt out per type when nothing in the type reads its children's props.
Workaround we use: an inline <head> script, defined before the component bundles load, that traps window.dash_mantine_components and deletes the flag from the menu and tooltip types.
- 主要言語
- Python
- スター
- 24.4k
- フォーク
- 2.3k
- 平均マージ
- 2日 13時間
- マージ済み PR(30日)
- 20
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
plotly/dash のほかの issue
-
P2 plotly-internal size: 1 task
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 2 日以内に返信
-
Extract graph schema validation into properly named test対応中かも @Nice6042 が 55 日前に担当しました。 オープンgood first issue P3 size: 1 task
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 2 日以内に返信
-
[BUG] dcc.Dropdown: hidden focus-target input is focusable inside aria-hidden and can overflow its wrapper対応中かも @KoolADE85 が 2 日前に担当しました。 オープンbug P2 size: 1
難易度 4/5 3〜5日 初心者へのやさしさ 56/100
plotly/dash#4042 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 2 日以内に返信
-
P3 plotly-internal size: 10+ task
難易度 5/5 1週間以上 初心者へのやさしさ 30/100
メンテナーはふだん 2 日以内に返信
-
P2 plotly-internal size: 5 task
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
メンテナーはふだん 2 日以内に返信
似ている issue
-
難易度 1/5 1〜3時間 初心者へのやさしさ 85/100
pytest-dev/pluggy#757 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1〜3時間 初心者へのやさしさ 85/100
NousResearch/hermes-agent#134960 ·
メンテナーはふだん 1 日以内に返信
-
HTML backend: `<br>` leaks the internal sentinel U+E000 into list items, headings and captions対応中かも @morten-lagabote が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
docling-project/docling#4671 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
good first issue hacktoberfest infra
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信