dash-renderer: determineChangedProps scans every layoutHashes entry for each dashChildrenUpdate component on every store update
Los mantenedores suelen responder en 2 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 48/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- javascript, react
- Área
- frontend, performance
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Python
- Estrellas
- 24.4k
- Forks
- 2.3k
- Merge medio
- 2 d 13 h
- PR fusionados (30 d)
- 20
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de plotly/dash
-
P2 plotly-internal size: 1 task
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 2 días
-
Extract graph schema validation into properly named testPosiblemente ocupada @Nice6042 la tomó hace 55 días. Abiertogood first issue P3 size: 1 task
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
plotly/dash#3735 · 3 comentarios ·
Los mantenedores suelen responder en 2 días
-
[BUG] dcc.Dropdown: hidden focus-target input is focusable inside aria-hidden and can overflow its wrapperPosiblemente ocupada @KoolADE85 la tomó hace 2 días. Abiertobug P2 size: 1
Dificultad 4/5 3-5 días Aptitud para principiantes 56/100
plotly/dash#4042 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 2 días
-
Linter/Type Checking ReplacementAbiertoP3 plotly-internal size: 10+ task
Dificultad 5/5 Más de una semana Aptitud para principiantes 30/100
plotly/dash#4040 · 3 comentarios ·
Los mantenedores suelen responder en 2 días
-
Drop Python 3.9 SupportAbiertoP2 plotly-internal size: 5 task
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
plotly/dash#4038 · 2 comentarios ·
Los mantenedores suelen responder en 2 días
Todos los issues de plotly/dash
Issues similares
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 85/100
pytest-dev/pluggy#757 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 85/100
NousResearch/hermes-agent#134960 ·
Los mantenedores suelen responder en 1 día
-
HTML backend: `<br>` leaks the internal sentinel U+E000 into list items, headings and captionsPosiblemente ocupada @morten-lagabote la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
docling-project/docling#4671 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Los mantenedores suelen responder en 1 día
-
good first issue hacktoberfest infra
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día