Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speed up load with 2% by improving _register_watcher #888

Open
MarcSkovMadsen opened this issue Nov 11, 2023 · 3 comments
Open

Speed up load with 2% by improving _register_watcher #888

MarcSkovMadsen opened this issue Nov 11, 2023 · 3 comments
Labels
performance Memory usage, attribute read/write speed, etc

Comments

@MarcSkovMadsen
Copy link
Collaborator

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

@MarcSkovMadsen MarcSkovMadsen added TRIAGE User-submitted issue that hasn't been triaged yet. and removed TRIAGE User-submitted issue that hasn't been triaged yet. labels Nov 11, 2023
@MarcSkovMadsen MarcSkovMadsen modified the milestone: Wishlist Nov 11, 2023
@MarcSkovMadsen MarcSkovMadsen added the performance Memory usage, attribute read/write speed, etc label Nov 11, 2023
@maximlt
Copy link
Member

maximlt commented Nov 11, 2023

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.

@philippjfr philippjfr transferred this issue from holoviz/panel Nov 11, 2023
@maximlt
Copy link
Member

maximlt commented Nov 11, 2023

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

@MarcSkovMadsen
Copy link
Collaborator Author

Python 3.10 and Linux

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Memory usage, attribute read/write speed, etc
Projects
None yet
Development

No branches or pull requests

2 participants