pyodide / pyodide/pyodide-pack
Rewrite package code to reduce inter-module dependencies
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 48
- Forks
- 9
- PR merge metrics
- No merged PRs in 30d
Description
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.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names no files, tests, or entry points. Start by scoping whether the work should target manual upstream fixes or automatic AST-based rewriting, then define a bounded case and measurable size or load-time improvement as the completion criteria.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100