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
One reason why this bundler is not able to reduce sizes that much is because of the convention of using top-level imports in Python.
With top-level imports, even if a functionality is required for a function that we don't use, if we use other functions from that module, it would have to be included. This is particularly problematic for dynamic libraries which take a long time to load.
There are two ways around this,
Manual fixes: we could do upstream fixes, to reduce inter-module dependencies
Automatic code rewrites: one could imagine, under some conditions, trying to rewrite all code (e.g. via AST) to move top level imports under the functions / methods where they are used. Maybe starting by doing this only for .so libraries, and or imports used only a few times.
The text was updated successfully, but these errors were encountered:
One reason why this bundler is not able to reduce sizes that much is because of the convention of using top-level imports in Python.
With top-level imports, even if a functionality is required for a function that we don't use, if we use other functions from that module, it would have to be included. This is particularly problematic for dynamic libraries which take a long time to load.
There are two ways around this,
The text was updated successfully, but these errors were encountered: