You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As everyone already knows, StarRocks is a fast database, but it has a relatively slow compilation process.
The primary factor contributing to the long compile times is the use of C++ templates. To eliminate the overhead of virtual function calls and ensure that every function is type-specific, many functions are implemented using C++ templates. This allows the compiler to better inline and vectorize the code. However, the downside is that the code size increases significantly, resulting in slower compilation and larger binary sizes.
To address this issue, we have several strategies in mind:
Remove unnecessary header files: By moving includes from common headers into the corresponding .cpp files, we can reduce the compiler’s frontend time.
Limit over-templating: Avoid templating everything and focus only on cases where it brings substantial benefits.
Tasks
Refactoring the compiling model with c++ modules
Remove unnecessary header files
Generate a quantitative analysis report of the whole compiling process, figure out the heavy headers
update 20241024: tried this tool, but it cannot actually remove any unused includes. But with VSCode it also use this tool, looks like need more investigation
Prefer forward-declaration than include header file
Limit over-templating(Reduce object file size)
Use bloaty to get a precise compiled size within binary
Thanks man. As there's actually a lot of cleanup work, i've not figured out a smart tool to automate these work). I think you can either start with some cleanup work(removing unnecessary includes or optimize large object files) or trying to leverage some tools. The first is much easier, if you can understand how does our build process work.
clang-include-fixer: tried this tool, but it cannot actually remove any unused includes. But with VSCode it also use this tool, looks like need more investigation
Motivation
As everyone already knows, StarRocks is a fast database, but it has a relatively slow compilation process.
The primary factor contributing to the long compile times is the use of C++ templates. To eliminate the overhead of virtual function calls and ensure that every function is type-specific, many functions are implemented using C++ templates. This allows the compiler to better inline and vectorize the code. However, the downside is that the code size increases significantly, resulting in slower compilation and larger binary sizes.
To address this issue, we have several strategies in mind:
Tasks
Remove unnecessary header files
Limit over-templating(Reduce object file size)
Top 20 object files, summarized as 588MB
The text was updated successfully, but these errors were encountered: