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

protobuf-src compile time increased massively from v1.1.0 -> v2.1.0 #24

Open
paulheinr opened this issue Nov 14, 2024 · 6 comments
Open

Comments

@paulheinr
Copy link

Hi there, this is more a discussion than an issue. We are using protobuf-src in a project: https://github.com/matsim-vsp/parallel_qsim_rust

I wanted to switch from v1.1.0 to v2.1.0 and noticed an increased compile time of protobuf-src (from 1-2min to 6-7min) on my Mac. I am wondering whether any body else is facing the same issues. I am considering a downgrade because the compile time is too long.

Do you have an idea why this is the case and how to accelerate the compile process?

System settings

  • Processor: 2,6 GHz 6-Core Intel Core i7
  • Memory: 32 GB 2667 MHz DDR4
  • OS: macOS 14.5
  • cmake version 3.31.0
  • cargo 1.82.0
  • rustc 1.82.0
@antiguru
Copy link
Member

This is your problem: rustc 1.82.0. See rust-lang/rust#132064

@paulheinr
Copy link
Author

Thank's for the hint!

@kesyog
Copy link

kesyog commented Dec 29, 2024

FYI there's a great chance this issue would be fixed by rust-lang/cmake-rs#229. One workaround in the meantime is to set the CMAKE_BUILD_PARALLEL_LEVEL environment variable based on NUM_JOBS for OSX builds.

@teskje
Copy link

teskje commented Jan 6, 2025

I think this isn't caused by the rustc 1.82.0 slowness after all. With rustc 1.83.0 I'm seeing the same thing on my Macbook:

$ cd protobuf-src
$ git checkout protobuf-src-v1.1.0git checkout protobuf-src-v1.1.0
$ cargo clean
$ cargo build
   Compiling cc v1.0.72
   Compiling autotools v0.2.5
   Compiling protobuf-src v1.1.0+21.5 (/Users/jan/devel/rust-protobuf-native/protobuf-src)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 47.80s
$ git checkout protobuf-src-v2.0.0
$ cargo clean
$ cargo build
   Compiling cc v1.0.97
   Compiling cmake v0.1.50
   Compiling protobuf-src v2.0.0+26.1 (/Users/jan/devel/rust-protobuf-native/protobuf-src)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 4m 53s

Seeing how cmake only pops up with v2.0.0, @kesyog's diagnosis seems right.

@teskje teskje reopened this Jan 6, 2025
@teskje
Copy link

teskje commented Jan 6, 2025

$ git checkout protobuf-src-v2.0.0
$ cargo clean
$ env CMAKE_BUILD_PARALLEL_LEVEL=10 cargo build
   Compiling cc v1.0.97
   Compiling cmake v0.1.50
   Compiling protobuf-src v2.0.0+26.1 (/Users/jan/devel/rust-protobuf-native/protobuf-src)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 53.77s

See also the discussion in #25

@benesch
Copy link
Member

benesch commented Jan 6, 2025

Yeah, I think this is almost certainly what @kesyog reported. Still waiting on his PR to cmake-rs to be merged and released. 😞

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

No branches or pull requests

5 participants