gator
gator copied to clipboard
Option to disable background loading. Performance improvement on JupyterLab startup.
Description
Can Gator provide an option to disable background loading? Mamba Gator is slowing down the JupyterLab at startup.
Reproduce
mamba install -y mamba_gator
- Go to JupyterLab after startup.
Expected behavior
Limitating resource usage or option to disable background loading. A better performance.
Context
Environment: K8s CPUs: 2 Memory: 8G
Thanks for the suggestion @danilopeixoto
Introducing a new user setting will be best to address this. I can provide pointers if you want to push a PR.
Hi @fcollonval,
First, thank you for the Mamba Gator development.
Is this the line to add a condition?
https://github.com/mamba-org/gator/pull/42/files#diff-4cb47daf968330dba84ee8069d23ca03354e3e77068181e77f055b61f3719cceR41
Adding a condition here, will prevent the Gator from loading packages in background? Next loading events will happen just when using the Mamba Gator UI?
Is this the line to add a condition?
https://github.com/mamba-org/gator/pull/42/files#diff-4cb47daf968330dba84ee8069d23ca03354e3e77068181e77f055b61f3719cceR41
Indeed this is the one.
Adding a condition here, will prevent the Gator from loading packages in background? Next loading events will happen just when using the Mamba Gator UI?
Yes
To add a user parameter, you will need to edit the settings json schema (something like fromHistory
):
https://github.com/mamba-org/gator/blob/90be2e149ce5034172400831059300224cd2ba0a/packages/labextension/schema/plugin.json#L18
Then you can modify the line:
https://github.com/mamba-org/gator/blob/90be2e149ce5034172400831059300224cd2ba0a/packages/labextension/src/index.ts#L48
like that:
- Private.loadPackages(model);
+ if (settings?.get('<param name>') ?? true) {
+ Private.loadPackages(model);
+ }
Thanks @fcollonval. Created #190.
Closing as resolved.