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

Bundle size analysis #2010

Open
turbocrime opened this issue Jan 31, 2025 · 0 comments
Open

Bundle size analysis #2010

turbocrime opened this issue Jan 31, 2025 · 0 comments
Labels
performance Related to speed improvements

Comments

@turbocrime
Copy link
Collaborator

turbocrime commented Jan 31, 2025

Issues like #1956 indicate bundle size is out of control.

Tools are available for analyzing bundle size. Size analysis could be diffed in CI to prevent unexpected ballooning of deployment artifacts.

vite-bundle-visualizer can easily visualize bundle size. default visualization attached below

it's apparent that the larger fraction of minifront bundle size relates to cosmos packages used for ibc. notably, the bundled content of @injectivelabs/core-proto-ts contains duplicated ESM and CJS trees. assuming a preference for ESM, this means there is 5.44MB of dead CJS code in the bundle from core-proto-ts alone.

obvious size wins:

  • deduplicate esm/cjs trees everywhere
  • deduplicate protobufs between peers
  • omit chain registry testnet data from production build
  • use the 'minimal' version of interchain ui kit

some peer deduplication might be achieved by aligning dependency versions, or by package manager overrides (though overrides may be dangerous).

output of vite-bundle-visualizer
@TalDerei TalDerei added the performance Related to speed improvements label Feb 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Related to speed improvements
Projects
None yet
Development

No branches or pull requests

2 participants