You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I did some research to determine a size breakdown for a "hello world" wasi-http component generated by componentize-py.
The TL;DR is that the stripped binary is about 18MB, 12MB of which is the data section with the pre-init memory snapshot, and the rest of which are the various modules, the largest of which is libpython312.so at about 4MB.
A stock, stripped libpython312.so is about 8MB, 4MB of which is data section(s) which get replaced with the memory snapshot when we pre-init.
The upshot is that we could save about 6MB per component by importing the modules it needs, but we'd still be looking at 12MB minimum component sizes. To reduce sizes further, we'd need some way to package the .py, .pyc, and related standard library files into a composable VFS component we could publish to a registry and reuse. And we'd also need a standard way to export a pre-init function that can be run by the host (e.g. at deployment time) to minimize cold-start times since we wouldn't be doing pre-init at build time anymore. See also #23
This would dramatically reduce binary sizes in cases where the host can provide these libraries.
The text was updated successfully, but these errors were encountered: