-
-
Notifications
You must be signed in to change notification settings - Fork 64
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
Make the requirements archive to install at init #1022
Comments
Interesting! In most apps I've built with Stlite, installing packages definitely took +70% of the boot-up time. I'm no expert in the underlying technology behind Stlite, but I wonder what other similar parts that could be done at build time? |
This is the network profile capturing the initialization phase of Stlite Sharing. The most time-taking part is loading the packages into the memory, rather than network access itself in my env. Especially the last bulk of the network accesses includes many small ones which cause the long idle time as shown below, and it looks like a room for improvement in this approach. |
This approach can't be introduced to Stlite Sharing because the user updates the requirements and the dependencies are resolved at runtime so we can't package the initial fixed site-packages. |
However, the prebuilt packages must be installed from the Pyodide distribution and their versions are fixed anyway. Moreover, when there is no user-specified requirements, the packages loaded from PyPI is just two (blinker and tenacity) so we can ignore them and dealing with the prebuilt package wheels should have more impacts. Because of this problem (#572, and maybe #833), the prebuilt packages can't be pre-installed in the site-packages. We should consider another way, e.g. package the wheels into a single archive, download and unpack it at runtime, and install them one by one with Update: There is no HOL blocking. The CDN we are using supports HTTP/2 and HTTP/3. The green indicated "waiting the server response", not "in the queue". |
#1053 is an experimental PR implementing loading a single archive of the required prebuilt packages. |
Compare them:
Looks like this approach doesn't make so much improvement. Also, the impl includes a kind of hack using Pyodide's hidden API. |
TODO: Measure the loading performance again with Chrome's network throttle simulator. |
One major time-taking part of the init process may be downloading and installing the packages (we must measure it first!).
So utilizing the archive-loading feature that is currently used in
@stlite/desktop
only may improve it.@stlite/mountable
from CDN.The text was updated successfully, but these errors were encountered: