Skip to content
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

Merged
merged 2 commits into from
Mar 21, 2024
Merged

Conversation

prrao87
Copy link
Member

@prrao87 prrao87 commented Mar 20, 2024

Running cargo build after setting export 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 the cargo 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.

//! 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.
Copy link
Collaborator

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

Copy link
Member Author

@prrao87 prrao87 Mar 20, 2024

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.

Copy link

codecov bot commented Mar 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.71%. Comparing base (e49bb30) to head (84eb3df).
Report is 2 commits behind head on master.

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.
📢 Have feedback on the report? Share it here.

@prrao87 prrao87 merged commit 3c90c16 into master Mar 21, 2024
17 checks passed
@prrao87 prrao87 deleted the rust-docs branch March 21, 2024 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants