Skip to content
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

Reduce web bundle size #10307

Closed
5 tasks done
rebornix opened this issue Jun 3, 2022 · 2 comments
Closed
5 tasks done

Reduce web bundle size #10307

rebornix opened this issue Jun 3, 2022 · 2 comments
Assignees
Labels
debt Code quality issues

Comments

@rebornix
Copy link
Member

rebornix commented Jun 3, 2022

Currently the unzipped bundle size for Web bits is 4.67MB. Considering that the web extension doesn't support bundle splitting, a large bundle file means long download and evaluation (activation).

image

There have been quite some good efforts to reduce the bundle size. We can follow the same patterns and also leverage the eslint rules to ensure that we don't overlook them in the future. From a 10000 feet bird view, we can do at least following to bring down the bundle size noticeably:

  • Load lodash function modules only Avoid loading full lodash #10308
  • Mark moment.js as external as it's not used by us, or jupyterlab sub-components we depend on
  • semver is used for Python intepreter and Python extension versions check, we probably don't need this in Web. If so, make sure we are not referecing semver in Web related code paths
  • hash. We use sha1, sha256, sha512 only, no need to reference them all. Also we can validate if we need all three sha algorithms.
  • fnv. Originally introduced for A/B testing in Python db297c4. The code sets the default algorithm to fnv and now it's used as default way to generate file hash https://github.com/microsoft/vscode-jupyter/blob/main/src/kernels/jupyter/preferredRemoteKernelIdProvider.ts#L55
    • To move off fnv, we would need a migration plan to move from fnv to simpler hashes as sha512.
  • External/Ideas
    • Load sub modules from jupyterlab/services instead of the whole bundle
    • Replace url-parse with inhouse vscode.Uri.parse
@rebornix rebornix added the bug Issue identified by VS Code Team member as probable bug label Jun 3, 2022
@rebornix rebornix self-assigned this Jun 3, 2022
@rebornix rebornix added the debt Code quality issues label Jun 3, 2022
@github-actions github-actions bot added the triage-needed Issue needs to be triaged label Jun 3, 2022
@greazer greazer added engineering and removed triage-needed Issue needs to be triaged labels Jun 6, 2022
@rebornix
Copy link
Member Author

rebornix commented Jun 13, 2022

image

We have already reduced the web bundle size by 25% on latest main.

@rebornix rebornix mentioned this issue Jun 21, 2022
9 tasks
@rebornix rebornix removed the bug Issue identified by VS Code Team member as probable bug label Dec 27, 2022
@DonJayamanne
Copy link
Contributor

Closing this for now, as I do not think anything else needs to beon done here.
At least not for now, if we do, we can create concrete issues with details

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
debt Code quality issues
Projects
None yet
Development

No branches or pull requests

3 participants