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

crate_universe: Only compile label regex once. #2751

Merged
merged 4 commits into from
Jul 31, 2024

Conversation

criemen
Copy link
Contributor

@criemen criemen commented Jul 19, 2024

I hit this when profiling for something else, we spent 1.1sec of 1.3sec of cargo-bazel generate compiling this regular expression. It seems to be quite bad on the regex compiler, as even compiling it once takes 8ms.

I had to add the once_cell crate to unwrap the Result type - the corresponding stdlib function is still nightly-only unfortunately. However, that crate was already in the transitive dependency tree, so it's a net-same change.

@criemen
Copy link
Contributor Author

criemen commented Jul 19, 2024

Can someone please push the correct, re-vendored dependencies here? I spent now 30min trying to get this to work locally, but it's not working for me.

@criemen
Copy link
Contributor Author

criemen commented Jul 30, 2024

Revendoring the dependencies helped with some CI jobs, but the BCR jobs still complain about a lockfile being out of date. I ran the suggested command locally in examples/bzlmod/hello_world, but that doesn't seem to satisfy CI. Can someone help me out here?

Copy link
Collaborator

@UebelAndre UebelAndre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this! I think there are some extra things you'll need manually to update on the bzlmod side of this. See #2368

crate_universe/Cargo.toml Outdated Show resolved Hide resolved
criemen and others added 4 commits July 31, 2024 20:29
I hit this when profiling for something else, we spent 1.1sec of 1.3sec
of `cargo-bazel generate` compiling this regular expression.
It seems to be quite bad on the regex compiler, as even compiling it once
takes 8ms.
@criemen
Copy link
Contributor Author

criemen commented Jul 31, 2024

Thanks! CI finally passed on this.
That was harder than expected given the size of the core change...

Copy link
Collaborator

@UebelAndre UebelAndre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! For this change I probably would have just regenerated dependencies for crate_universe directly but thank you for going above and beyond here 😄

@UebelAndre UebelAndre added this pull request to the merge queue Jul 31, 2024
Merged via the queue into bazelbuild:main with commit 9510ab4 Jul 31, 2024
3 checks passed
@criemen criemen deleted the label-fix branch July 31, 2024 21:37
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