Replies: 2 comments 1 reply
-
@jihuayu Thanks for your great proposal. I think it's unnecessary to enable the IPO and static link the libc when building with the debug mode. @apache/kvrocks-committers |
Beta Was this translation helpful? Give feedback.
0 replies
-
If you want to have a better build performance (including incremental build), make sure you are using ninja, clang, and lld (or mold). You can use lld easily via adding |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
While working on the kvrocks code, I need to repeatedly compile the program in order to debug my code.
I generate the makefile using
./x.py build
, and then I usemake kvrocks
in the build folder to complete the subsequent build.I noticed that a amount of time is being spent linking the kvrocks file. In typical cases where only one file is being modified, the default configuration takes around 55 seconds to complete.
The build speed is quite slow. I tried some other approaches and found that by disabling the cmake parameters ENABLE_STATIC_LIBSTDCXX and ENABLE_IPO, the build time decreased to 12s, with a linking time of 5s. This has resulted in a significant improvement.
Then, I change the cmake script, replacing the default linker with mold. This resulted in a reduced build time of 8 seconds, with the linking time even less than 1 second. This is truly awesome.
I have make a table below. We can observe and compare the time taken under different circumstances.
I believe I can submit a pull request to add support for MOLD's cmake parameters.
Additionally, I suggest creating a documentation guide to help new developers have a more comfortable experience developing kvrocks.
I would like to ask if there are any other best practices that everyone can share?
Beta Was this translation helpful? Give feedback.
All reactions