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
Allow tree shaking of the core environment when it is unobservable. #478
Conversation
08ff87e
to
e8051b1
Compare
We can avoid loading the full core environment if the mutable parts of core are not reachable from the main function. This is quite a large number of programs. This change makes 'hello world' 2-3 times faster, and uses approximately 10 times less ram.
e8051b1
to
0fefca4
Compare
I feel this approach could be improved/altered with any of:
|
I like this idea a lot, and rather than implement hacks to get around certain issues, I think it might be worth considering changing the core library to avoid any calls (directly or indirectly) |
BTW, this draft is not dead, just pending changes to the thread module, which seem to be the biggest hurdle in adding the functionality. , It is currently quite difficult to remove any references to the |
Add --no-core option to quickbin, as well as :no-core option to declare executable. This doesn't use the autodetection when making binaries, instead opting for manual intervention.
The commits I have added have taken some of the code from here, but reworked. Mainly, we don't use the auto-dectection since there are cases where the auto-detection can fail, say when loading a native module that tries to use Example usage:
With core library disabled:
Without core library disabled:
|
Here are some local results:
|
nice, thanks, it should be useful for programs like jfmt. |
We can avoid loading the full core environment if the mutable
parts of core are not reachable from the main function. This
is quite a large number of programs.
This change makes 'hello world' 2-3 times faster, and uses approximately
10 times less ram.