-
Notifications
You must be signed in to change notification settings - Fork 104
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
Rust crate compile times on macOS arm64 are incredibly slow #3784
Comments
@benjaminwinger not urgent - just wanted to put this here as I don't think it's been pointed out before (most users of the Rust crate seem to be on Linux). |
To clarify, is this just an issue with parallelism in the bundled C++ build, or is it something else? That is, does setting |
Just to clarify, I'm behaving like the general user and doing the following to use the Rust API to construct a graph: cargo new my_project
cd my_project
cargo add kuzu
cargo build Because it takes so long to build, I cleared out my cargo cache, deleted the project, recreated it, and then tried doing |
I can confirm that this is caused by not detecting the correct parallelism by default. On my Macbook Pro with M2 Max, The default configuration for However, if I manually setup the
The build "Finished |
This should have nothing to do with whether the machine is x64 or arm64 architecture. |
That's great! I'll make a note to document this as well, this is something macOS users should know. We can go ahead and close this if you think no further improvements in performance are possible. |
I am not very familiar with Rust toolchain, but I think @benjaminwinger might have a way to detect number of threads and inject it into the build configuration at https://github.com/kuzudb/kuzu/blob/master/tools/rust_api/build.rs |
Actually yes, Ben mentioned that he was able to automatically do this in Linux, but on macOS he was only able to test on x86. He would need a way to test on arm64 (or at least suggest to you or me what we could try) so that we can avoid having to manually set the number of build processes each time - that command you showed is really tedious. |
He can ssh as |
I had actually seen this when testing on the x86_64 macos server before, however @prrao87 said that setting It looks like Cargo sets a
|
Description
I'm on macOS Sonoma 14.5 (M3 Macbook), and I'm revisiting the Rust crate's compile time issue I'd noticed earlier on macOS. In 0.4.2 of Kùzu, running
cargo build
gets stuck on step 35/38 of the compilation process (the step in which the Kùzu linking happens). Eventually, after 5-8 minutes, it finally compiles and I can then docargo run
. I'd expectcargo build --release
to take even longer than this.Changing the environment variables like we discussed earlier
CARGO_BUILD_JOBS
, or manually settingCMAKE_BUILD_PARALLEL_LEVEL
may help with building from source, but I'm thinking from an end user perspective (setting either of these prior tocargo build
has no effect).Is there any way at all the compile times for the Rust crate could be improved on arm64 Macs? Waiting 5-8 mins seems unreasonable, even if it's for the first build only.
The text was updated successfully, but these errors were encountered: