Skip to content

Prop tests in Debug=True slow when manipulating lots of children #3243

@BSd3v

Description

@BSd3v

Good day,

You can find a discussion here for some examples: RenaudLN/dash-pydantic-form#86

Anyways, if you run the below example with:

dash>=3.0.0
dash-mantine-component==1.1.0

import dash_mantine_components as dmc
from dash import Output, Input, html, callback, Dash, ctx, _dash_renderer
from dash.exceptions import PreventUpdate
from dash_iconify import DashIconify

# this is optional when using dash >3.0.0
_dash_renderer._set_react_version("18.2.0")

app = Dash(__name__, external_stylesheets=dmc.styles.ALL)

app.layout = dmc.MantineProvider(
    [
        dmc.Accordion(
            [dmc.AccordionItem([
                dmc.AccordionControl(f'{x}'),
                dmc.AccordionPanel([
                    html.Div([dmc.Anchor(f'{y}', href=f'{y}'), dmc.Text(), dmc.TextInput()]) for y in range(100)
                ])
            ], value =f'{x}') for x in range(10)]
        )
    ]
)


if __name__ == "__main__":
    app.run(debug=True)

If you keep as is, it takes a good amount of time to render an update to the accordion. If, however, you disable debug mode, the results are what we would expect less than half a second to open.

This seems to be related to the check props while in debug mode. This needs to be more efficient, or possibly even controlled by the app configuration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1needed for current cyclebugsomething brokenperformancesomething is slowregressionthis used to work

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions