-
Notifications
You must be signed in to change notification settings - Fork 94
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
Update rustdoc to show how to enable parallel compilation #3099
Conversation
tools/rust_api/src/lib.rs
Outdated
//! If you need to access multiple databases you will need to do so in separate processes. | ||
//! | ||
//! ## Building | ||
//! | ||
//! By default, the kuzu C++ library will be compiled from source and statically linked. | ||
//! Set the `CMAKE_BUILD_PARALLEL_LEVEL` environment variable to a higher value than 1 (e.g., 8-20) | ||
//! to speed up compilation of the C++ library. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The parallelism should be passed to cmake by default by the cmake-rs
crate. It sounds like there are sometimes issues with this, but I think the wording should be adjusted to reflect that this is in case of problems with that, rather than something that is normally required.
Maybe, something like:
If the kuzu C++ library is not being built using multiple threads by default, you can use the
CMAKE_BUILD_PARALLEL_LEVEL
environment variable to manually set the number of threads for the build
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I rephrased it to make it seem totally optional rather than something the user needs to do.
If the kuzu C++ library is not being built using multiple threads by default, you can set the
CMAKE_BUILD_PARALLEL_LEVEL environment variable to potentially speed up the build process.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #3099 +/- ##
==========================================
- Coverage 92.73% 92.71% -0.02%
==========================================
Files 1162 1162
Lines 43198 43140 -58
==========================================
- Hits 40059 39999 -60
- Misses 3139 3141 +2 ☔ View full report in Codecov by Sentry. |
Running
cargo build
after settingexport CMAKE_BUILD_PARALLEL_LEVEL=20
(or some similar high value) significantly speeds up the compilation process. Because we can't know what a reasonable number of threads might be for users (it depends on the arch and the OS), I've added an additional step in the rustdoc to explain that this setting helps.On my Mac, setting
CMAKE_BUILD_PARALLEL_LEVEL
to 20 results in a 5x speedup in thecargo build
step, so we should definitely document this on the Kùzu docs as well. Will make a note of this and add it there.