Skip to content

Speed up initial load 3% by not resolving the same paths over and over again #5852

@MarcSkovMadsen

Description

@MarcSkovMadsen

I'm on the main branch of Panel trying to find performance improvements.

I can see that its quite expensive (3% of app load time) to lookup the p attribute on the theme. It should not be like that. Its the same path we are loading again and again and again.

image

The problem is in Param where the raw_path is being resolved again and again.

image

Reproduce

import panel as pn

N=10

pn.Column(
    *[pn.Row(
        *[pn.pane.Markdown("Hello World") for i in range(N)]
    ) for i in range(N)]
).servable()

Run

 panel serve script.py --autoreload --index script --admin --profiler pyinstrument

Open the app 5 times and inspect the pyinstrument report.

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions