-
Couldn't load subscription status.
- Fork 472
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.sosizeCommands 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:
Sassnamespace has been renamed toSass2Scssto avoid conflicts (upstream PR Rename namespace to Sass2Scss mgreter/sass2scss#43).src/cencode.cto compile under C++.See also request for this feature in the Ruby bindings repo: sass/sassc-ruby#132.