Reducing code-size for web version
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 13.7k
- Forks
- 1.1k
- PR merge metrics
- No merged PRs in 30d
Description
Currently even the minified version is a whopping 2.04 MB which is a rather heavy even when gzipped. Looking through the code, I noticed that Emscripten's canvas, SDL audio and requestAnimationFrame are included in the minified output, which are obviously not used by SQLite.
When compiling only for browser, ENVIRONMENT_IS_NODE and ENVIRONMENT_IS_SHELL would be false and could be dead-code eliminated. Also, the filesystem and TTY also takes out a substantial chunk of code which could be unnecessary. _sysconf is also ever called with 30 so it could be aggressively inlined.
I wonder if there are options to set which could reduce the code size?
Contributor guide
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
Start by reviewing the browser compilation configuration and how Emscripten includes canvas, SDL audio, requestAnimationFrame, filesystem, TTY, and _sysconf in the minified output. Determine which compilation options can exclude unused code, then verify that the browser build remains functional with a reduced minified size.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, sqlite, wasm
- Domain
- build-system, database, web-dev
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100