-
Notifications
You must be signed in to change notification settings - Fork 463
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 an option to amalgamate sources before compilation #2979
base: master
Are you sure you want to change the base?
Conversation
0c7df44
to
3692c40
Compare
AFAIKS these builds are normally called unity builds. Only reason we haven't adopted it so far is memory constraints. Can you @glebm give some numbers how much free memory is needed to compile the "amalgamate" sources? See #2888 (comment) https://stackoverflow.com/questions/543697/include-all-cpp-files-into-a-single-compilation-unit |
@mgreter I've added max RSS usage to the comparison table. It's 747M (without it: 321M). Note that in this PR amalgamation is disabled by default. |
a7be68a
to
210fd5a
Compare
For the review request, I have three main questions:
|
1. Avoid include cycles. This isn't necessary for amalgamation but makes things more obvious. 2. Rename sass2scss namespace to Sass2Scss (upstream PR mgreter/sass2scss#43). This is necessary for amalgamation.
Sources are #included instead of inlined by default.
Not in all configs, but we do test the separated build with Do we want to double the number of test configurations?
This is actually what we do by default. The default can be changed by passing The I've now added a description of the
No but I hope this won't be too difficult to add in the future, though distributing the |
Any update? |
Amalgamation reduces single-core compilation time by 50% and the shared library size by 10%.
SQLite has a great writeup on amalgamation here: https://www.sqlite.org/amalgamation.html.
lib/libsass.so
sizeCommands for measurement:
With amalgamation:
Without amalgamation:
Also enables amalgamation on CI for non-autotools builds (to make it faster and also test the amalgamated build).
A couple of minor source changes were necessary:
Sass
namespace has been renamed toSass2Scss
to avoid conflicts (upstream PR Rename namespace to Sass2Scss mgreter/sass2scss#43).src/cencode.c
to compile under C++.See also request for this feature in the Ruby bindings repo: sass/sassc-ruby#132.