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

Speed of hermetic_cc vs straight clang #177

Closed
kylepl opened this issue May 6, 2024 · 2 comments
Closed

Speed of hermetic_cc vs straight clang #177

kylepl opened this issue May 6, 2024 · 2 comments

Comments

@kylepl
Copy link

kylepl commented May 6, 2024

Hi,

I've been enjoying using hermetic_cc_toolchain for the last year, but was exploring some changes to LLVM, so set up my Bazel project to use it directly as an alternative, and discovered along the way that my iteration cycle on a large test was much faster.

e.g. if I change one file, which forces a re-link:

  • Straight clang (that I built from source) takes ~65 seconds
  • hermetic_cc_toolchain takes ~110 seconds.

Thus clang is running ~40% faster. That being said, I'm using clang 18, and, while I'm not certain, zig seems to be using clang 17.

So I'm happy to investigate further (e.g. try older clang), or try to create a reproducible example, but was first curious if this was known or expected.

Thanks!

@motiejus
Copy link
Collaborator

motiejus commented May 8, 2024

~60 seconds sounds about the time of compiling libcxx and glibc, which are used only in link actions.

Does Zig see your zig cache folder correctly?

@kylepl
Copy link
Author

kylepl commented May 28, 2024

Ah, this was it. It took my smaller test (which is easier to see the difference in build times since there is less variance) from ~30 seconds -> ~6 seconds. Thanks!

Perhaps it would be worth having it export a warning to Bazel in these cases so it is easier to notice.

@kylepl kylepl closed this as completed May 28, 2024
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

2 participants