holoviz/param

Speed up load with 2% by improving _register_watcher

Opened this issue · 3 comments

I'm on the main branch of Panel trying to find performance improvements. I can see that _register_watcher shows up spending ~8% of the time in the profiling report.

image

My guess is that this can be improved 25% by looking up things more efficiently and testing in on sets or dictionaries instead of lists.

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 --index script --admin --profiler pyinstrument

Open the app 5 times and inspect the performance report.

image

Hi @MarcSkovMadsen, some of the performance issues you've opened look like they belong to Param? And Param now has a benchmark suite so we could measure the performance improvements there.

@MarcSkovMadsen could you please report the Python version you are using and your OS?

Python 3.10 and Linux