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 dynamic layout updates #4989

Merged
merged 7 commits into from
May 31, 2023
Merged

Speed up dynamic layout updates #4989

merged 7 commits into from
May 31, 2023

Conversation

philippjfr
Copy link
Member

@philippjfr philippjfr commented May 31, 2023

Addresses some of the slowness when dynamically updating a layout encountered in #4976

  • Cache loading_css (loading this from file each time is expensive)
  • Bokeh property access is expensive so we minimize it inside Panel._compute_sizing_mode
  • Preprocessors currently always iterate over the entire object tree, we implement an alternative preprocessor signature that is given access to both the Panel object that was changed and all submodels that were unchanged.
  • Do not add Link preprocessor unless Link is added
  • Do not run Link preprocessor unless Document has links

Before

Screen Shot 2023-05-31 at 11 55 08

After

Screen Shot 2023-05-31 at 12 22 01

@codecov
Copy link

codecov bot commented May 31, 2023

Codecov Report

Merging #4989 (4ced6a9) into main (0c2690c) will increase coverage by 10.00%.
The diff coverage is 78.94%.

@@             Coverage Diff             @@
##             main    #4989       +/-   ##
===========================================
+ Coverage   73.44%   83.45%   +10.00%     
===========================================
  Files         271      271               
  Lines       38293    38322       +29     
===========================================
+ Hits        28125    31981     +3856     
+ Misses      10168     6341     -3827     
Flag Coverage Δ
ui-tests 40.82% <32.89%> (?)
unitexamples-tests 73.43% <77.63%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
panel/layout/grid.py 75.13% <23.07%> (-0.61%) ⬇️
panel/layout/accordion.py 86.55% <66.66%> (-0.74%) ⬇️
panel/layout/card.py 92.53% <66.66%> (+0.11%) ⬆️
panel/theme/base.py 87.67% <66.66%> (-0.79%) ⬇️
panel/io/resources.py 87.26% <83.33%> (+0.02%) ⬆️
panel/layout/base.py 91.82% <94.73%> (+0.08%) ⬆️
panel/io/convert.py 72.18% <100.00%> (+46.99%) ⬆️
panel/layout/tabs.py 90.83% <100.00%> (+0.07%) ⬆️
panel/links.py 83.37% <100.00%> (+0.43%) ⬆️
panel/reactive.py 81.11% <100.00%> (+1.00%) ⬆️
... and 2 more

... and 58 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@philippjfr philippjfr merged commit 17e0ea7 into main May 31, 2023
10 of 14 checks passed
@philippjfr philippjfr deleted the optimize_layout branch May 31, 2023 11:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant