-
-
Notifications
You must be signed in to change notification settings - Fork 128
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
Performance for consecutive tab switching improvements #496
Comments
(3) achieves impressive results for very heavy notebooks in Chrome. You can test it by running the following cell in IPython notebook: %%html
<style>
.jp-MainAreaWidget.lm-Widget.lm-mod-hidden {
content-visibility: hidden;
display: block!important;
z-index: -1;
}
</style> To disable it switch the cell to raw. To re-enable switch it back to code and re-run. Here is the comparison for tab switching obtained form ui-profiler with scenario parametrized as: [
Launchers in my setup have 32 cards. To confirm that this is not a mistake, I re-run the benchmarks and and the results were in agreement (see details).
Lightweight scenariosOk, so content-visibility is great for very heavy notebooks. How does it behave in lightweight (e.g. Launcher) or moderate scenarios (a small notebook)? Previously we saw a performance drop for scale mode when many tabs are open. We can reproduce this by looking at an increasing number of launchers:
while When looking at notebooks (each with 20 code cells), content-visibility is a clean winner, irrespective of the number of tabs to traverse.
In any case, the gains for lightweight scenarios are not as impressive. |
Importantly, |
Problem
Some actions in the UI are expensive. When user navigates open tabs they may want to switch a few tabs ahead using a keyboard shortcut. Even with relatively low latency with windowed notebooks for any single tab, switch n tabs with large notebooks in a row may take too long for the user.
Related to jupyterlab/jupyterlab#4292 and jupyterlab/benchmarks#75
Proposed Solution
We could:
content-visibility
on tab-level to improve performance of tab switch. While previous work in jupyterlab-benchmarks repository investigated using content-visibility on cell level, this could be even more beneficial on widget level (in the same manner as Use composition to improve tab switch #231)previously I suggested using Houdini CSS Layout API but I no longer believe that this particular API exposes enough data to implement the caching mechanism that we needAdditional comments:
Additional context
Some browsers are also working on implementing another cache for closed tabs but this may be more difficult to leverage than back-froward cache.
Just if anyone was wondering, shadow-DOM does not help in this particular case (beyond reducing style recomputation scope) as it does not currently support any additional caching.
The text was updated successfully, but these errors were encountered: