dash-renderer: determineChangedProps scans every layoutHashes entry for each dashChildrenUpdate component on every store update
Mantenedores costumam responder em até 2 dias
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 48/100
- Tipo de issue
- Bug
- Clareza
- Razoavelmente clara
- Status de atividade
- Ativa
- Stack de tecnologia
- javascript, react
- Domínio
- frontend, performance
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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.
- Linguagem predominante
- Python
- Estrelas
- 24.4k
- Forks
- 2.3k
- Merge médio
- 2d 14h
- PRs com merge (30d)
- 23
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de plotly/dash
-
P2 plotly-internal size: 1 task
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Mantenedores costumam responder em até 2 dias
-
Extract graph schema validation into properly named testTalvez já em andamento @Nice6042 assumiu há 57 dias. Abertagood first issue P3 size: 1 task
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
plotly/dash#3735 · 3 comentários ·
Mantenedores costumam responder em até 2 dias
-
[BUG] dcc.Dropdown: hidden focus-target input is focusable inside aria-hidden and can overflow its wrapperTalvez já em andamento @KoolADE85 assumiu há 4 dias. Abertabug P2 size: 1
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 56/100
plotly/dash#4042 · 3 comentários · 1 responsável ·
Mantenedores costumam responder em até 2 dias
-
P3 plotly-internal size: 10+ task
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 30/100
plotly/dash#4040 · 3 comentários ·
Mantenedores costumam responder em até 2 dias
-
Drop Python 3.9 SupportAbertaP2 plotly-internal size: 5 task
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 35/100
plotly/dash#4038 · 2 comentários ·
Mantenedores costumam responder em até 2 dias
Todas as issues de plotly/dash
Issues semelhantes
-
request-theme
Dificuldade 2/5 Menos de uma hora Facilidade para iniciantes 70/100
LizardByte/ThemerrDB#8877 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
area/install-update comp/gateway P0 sweeper:risk-compatibility type/bug
Dificuldade 2/5 Menos de uma hora Facilidade para iniciantes 72/100
NousResearch/hermes-agent#135997 · 3 comentários ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
deepset-ai/haystack#13199 ·
Mantenedores costumam responder em até 1 dia
-
[BUG] JSONLoader rejects valid UTF-8 BOM filesTalvez já em andamento @zouyonghe assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
anthropics/knowledge-work-plugins#1298 ·
Mantenedores costumam responder em até 1 dia