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 compile times #896

Merged
merged 31 commits into from
Mar 1, 2024
Merged

Improve compile times #896

merged 31 commits into from
Mar 1, 2024

Conversation

Jake-Shadle
Copy link
Collaborator

This PR is basically general cleanup of the dependency tree and a shift from compiling protobufs at build time to just committing the generated files. Overall this change reduced clean release compile times on my machine by ~25% (~80s -> ~60s).

We were using https://docs.rs/kube-derive/0.88.1/kube_derive/ to derive CustomResource for FleetSpec, which also pulled in a duplicate version of darling and several of its transitive dependencies. This was completely unneeded and there was already a manual implementation in the same file for GameServerSpec. Also removed cached's default features which includes a derive macro we weren't using.

The biggest change in compile times came from getting rid of protobuf-src completely in favor of committed generated files. (I'm adding a CI check to ensure the protobufs stay up to date). Also the protobuf source files were copied into the repo rather than being in submodules (well, exception being protoc-gen-validate). For example, we were including googleapis, a 52MiB clone for...exactly 1 file that hasn't meaningfully changed (AFAICT), ever.

This removes protobuf-src as a dependency and default feature in favor of committing the generated rust files instead. On my machine this took a clean release build from ~80s to ~60s. To me it feels like the builds are still far slower than they should be but this is a good easy win.
If protobufs are generated without transport (and thus no ::connect method) the previous naming would cause infinite recursion rather than a compile time failure
Apparently git didn't like me removing submodules and changing the contents of the folders at the same time
Copy link

This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

Copy link

This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

Copy link

This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

Copy link

This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

Copy link

This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

Copy link

This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

Copy link

This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

Copy link

This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

Copy link

This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

Copy link

This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

Copy link

This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

Copy link

This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

Copy link

github-actions bot commented Mar 1, 2024

This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

Copy link

github-actions bot commented Mar 1, 2024

This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

Copy link

github-actions bot commented Mar 1, 2024

This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

Copy link

github-actions bot commented Mar 1, 2024

This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

Copy link

github-actions bot commented Mar 1, 2024

This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

Copy link

github-actions bot commented Mar 1, 2024

This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

Copy link

github-actions bot commented Mar 1, 2024

This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

@quilkin-bot
Copy link
Collaborator

Build Succeeded 🥳

Build Id: f47cab4a-0ce1-4782-9cc6-0e42e2f77a3a

The following development images have been built, and will exist for the next 30 days:

To build this version:

git fetch [email protected]:googleforgames/quilkin.git pull/896/head:pr_896 && git checkout pr_896
cargo build

@XAMPPRocky XAMPPRocky merged commit 1711b49 into main Mar 1, 2024
6 checks passed
@Jake-Shadle Jake-Shadle deleted the update-deny branch March 1, 2024 09:54
@markmandel markmandel added kind/feature New feature or request area/build-tools Development tooling. labels Mar 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/build-tools Development tooling. kind/feature New feature or request size/xl
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants