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

Investigate how to reduce Ketcher bundle size #4958

Closed
rrodionov91 opened this issue Jul 2, 2024 · 4 comments
Closed

Investigate how to reduce Ketcher bundle size #4958

rrodionov91 opened this issue Jul 2, 2024 · 4 comments
Assignees
Labels
feature request Test Cases Written Test cases has been written for that issue

Comments

@rrodionov91
Copy link
Collaborator

Background
Current js bundle size of Ketcher is 6.5MB. It leads to long initial ketcher loading time.

Solution
It needs to run bundle analyser and investigate options to reduce bundle size. Result of this ticket should be a list of other tickets related to concrete actions.

@rrodionov91 rrodionov91 added this to the Ketcher 2.24.0-rc.1 milestone Jul 2, 2024
@AlexeyGirin AlexeyGirin added the Test Cases Written Test cases has been written for that issue label Jul 9, 2024
@AlexeyGirin
Copy link
Collaborator

AlexeyGirin commented Jul 9, 2024

Test cases are not needed for that feature

@rrodionov91
Copy link
Collaborator Author

rrodionov91 commented Aug 3, 2024

Report from bundle analyzer:
ketcher-bundle-analysis-04-09-2024.zip

It was generated for build with indigo without render module and dynamic import of full indigo (#5190)

@rrodionov91 rrodionov91 self-assigned this Aug 6, 2024
@rrodionov91
Copy link
Collaborator Author

ketcher main bundle - 7.1MB

  • ketcher-core - 4.2MB

    • monomers library - 2.8MB(66%)
  • ketcher-react - 1.9MB

    • templates library - 530KB(27%)
  • ketcher-macromolecules - 1MB

  • ketcher-standalone - 200KB

miew chunk - 1.2MB (loads on demand)
ketcher-standalone with full indigo - 260KB (loads in background after indigo without render module initialisation)

—- conclusion —-

  • 47% of main bundle is occupied by the library. We need to split it to separate file and load in parallel with main bundle.
  • dependencies (node_modules) occupied ~15% of bundle size. We can split it into separate chunk.

@AlexeyGirin
Copy link
Collaborator

No verification required

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Test Cases Written Test cases has been written for that issue
Projects
None yet
Development

No branches or pull requests

2 participants