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

Add multiple CSpice build options #34

Closed
gkjohnson opened this issue Apr 13, 2021 · 0 comments · Fixed by #40
Closed

Add multiple CSpice build options #34

gkjohnson opened this issue Apr 13, 2021 · 0 comments · Fixed by #40
Milestone

Comments

@gkjohnson
Copy link
Contributor

gkjohnson commented Apr 13, 2021

It may be prudent to provide multiple versions of cspice.js for different use cases. For example if we can manage to lower the required statically allocated memory for a CSpice module instance we could provide a "thin" version of the source while defaulting to the full 100MB static memory variant. Some applications may prefer loading the ASM.js vs the WASM build depending on which browsers are being targeted.

The different CSpice variants could be guarded by global define (or function argument?) conditions that could dynamically import the appropriate version. If a static global define is used then tree shaking could conditionally remove it.

NOTES

  • Replacing instance of 00000] with 0000] brings the initial memory requirement down to ~78MB
  • Running a replace again of 0000] to 000] further decreases the requirement down to ~52MB
  • The above work in the existing demo file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants