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

Improve cargo-zigbuild zig performance #244

Open
breezewish opened this issue Apr 21, 2024 · 2 comments
Open

Improve cargo-zigbuild zig performance #244

breezewish opened this issue Apr 21, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@breezewish
Copy link
Contributor

breezewish commented Apr 21, 2024

I recently discovered my C++ projects builds notably slower when using cargo-zigbuild, compared with a cmake toolchain I craft manually similar to https://github.com/mrexodia/zig-cross

After some debugging, I found that the initial process of fn execute_compiler (everything before actual zig Command::run) takes heavy amout of time, almost equal to the Command::run itself:

image

It would be great if the initial time could be reduced. Thanks!

@messense messense added the enhancement New feature or request label Apr 22, 2024
@messense
Copy link
Member

Maybe we can cache some of the repeated works.

@breezewish
Copy link
Contributor Author

I guess most cost comes from spawning the Rust and Zig to checkout their versions. The versions could be checked when zigbuild is invoked and stored in zigcc-xx.sh.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants