-
Notifications
You must be signed in to change notification settings - Fork 103
Enable LTO, EVAL_CTOR #145
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
Conversation
The perf optimisations LTO and
What benefit does changing both files to What is the intent behind |
Regarding After #146, the only file embedded will be fonts.conf which currently weights 803 bytes, where the embedded result (base64 plus decoding code) comes at 1181 bytes (see next line).
About
|
Another note: the commit message and PR description currently disagree on whether this increases or reduces filesize.
Yup,
Thanks for the explanation! A (concise) version of this would be a great addition to the commit message :) I suggest this is split into multiple commits, each clearly documenting its purpose and if not blatanly obvious how/why, like this:
|
7a69b7f
to
a98adc2
Compare
I am moving init-mem and embed to #146, otherwise the commits have been split. I'll change the title of the PR |
Thanks! One last thing, the first commit’s description still claims LTO would reduce the output size. The PR description suggests and my test seems to verify it actually increases the output size (but iinm LTO is mainly for performance not size, so that’s fine):
|
Do link-time optimizations and pre-evaluate code. -s EVAL_CTORS=1 has no change in output currently. -flto increases output size after optimizations
When -flto is enabled emscripten will generate "system libraries" cache, for all available libraries, including non-used ones. This includes libGL.a, libal.a, libhtml5.a, which are not used in the project. Disabling AUTONATIVE_LIBRARIES decreases compile time with -flto enabled.
a98adc2
to
741d418
Compare
Most of my assumptions are pre-O3 changes on master, so they are all wrong. Have tested the changes introduced here and Reworded commit to show this + -flto size increases
|
These changes enable LTO for the build process, and decreases the number of files (data / mem files). While this increases total size slightly, it reduces the number of files fetched from network overall. This is further lowered down in a future PR where the fallback font is extracted from the binaries.
The output of the dist folder now looks like this:
EDIT: changes regarding number of files are being moved to #146