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

Cargo profile for building CLI more quickly #50

Merged
merged 2 commits into from
Jul 1, 2023

Conversation

jdetter
Copy link
Collaborator

@jdetter jdetter commented Jul 1, 2023

Description of Changes

https://www.notion.so/clockworklabs/Investigate-compile-time-in-release-b4245f3bb6f6479dba92dd1a8f5c080c?pvs=4

Clean compilation

Profile: release

    ...
    Finished release [optimized + debuginfo] target(s) in 2m 55s
   Replacing /Users/boppy/.cargo/bin/spacetime
    Replaced package `spacetimedb-cli v0.5.0 (/Users/boppy/clockwork/workspace3/SpacetimeDB/crates/cli)` with `spacetimedb-cli v0.5.0 (/Users/boppy/clockwork/workspace3/SpacetimeDB/crates/cli)` (executable `spacetime`)

Profile: release-fast

    ...
    Finished release-fast [optimized + debuginfo] target(s) in 1m 01s
   Replacing /Users/boppy/.cargo/bin/spacetime
    Replaced package `spacetimedb-cli v0.5.0 (/Users/boppy/clockwork/workspace3/SpacetimeDB/crates/cli)` with `spacetimedb-cli v0.5.0 (/Users/boppy/clockwork/workspace3/SpacetimeDB/crates/cli)` (executable `spacetime`)

Clean compliation speedup: ~1 minute 54 seconds

Incremental compilation

These tests were done by compiling the specified profile, then making a small edit to main.rs and then compiling again.

Profile: release

  Installing spacetimedb-cli v0.5.0 (/Users/boppy/clockwork/workspace3/SpacetimeDB/crates/cli)
    Updating crates.io index
   Compiling spacetimedb-bindings-macro v0.5.0 (/Users/boppy/clockwork/workspace3/SpacetimeDB/crates/bindings-macro)
   Compiling spacetimedb-sats v0.5.0 (/Users/boppy/clockwork/workspace3/SpacetimeDB/crates/sats)
   Compiling spacetimedb-lib v0.5.0 (/Users/boppy/clockwork/workspace3/SpacetimeDB/crates/lib)
   Compiling spacetimedb-cli v0.5.0 (/Users/boppy/clockwork/workspace3/SpacetimeDB/crates/cli)
    Finished release [optimized + debuginfo] target(s) in 2m 31s
   Replacing /Users/boppy/.cargo/bin/spacetime
    Replaced package `spacetimedb-cli v0.5.0 (/Users/boppy/clockwork/workspace3/SpacetimeDB/crates/cli)` with `spacetimedb-cli v0.5.0 (/Users/boppy/clockwork/workspace3/SpacetimeDB/crates/cli)` (executable `spacetime`)

Profile: release-fast

  Installing spacetimedb-cli v0.5.0 (/Users/boppy/clockwork/workspace3/SpacetimeDB/crates/cli)
    Updating crates.io index
   Compiling spacetimedb-cli v0.5.0 (/Users/boppy/clockwork/workspace3/SpacetimeDB/crates/cli)
    Finished release-fast [optimized + debuginfo] target(s) in 32.46s
   Replacing /Users/boppy/.cargo/bin/spacetime
    Replaced package `spacetimedb-cli v0.5.0 (/Users/boppy/clockwork/workspace3/SpacetimeDB/crates/cli)` with `spacetimedb-cli v0.5.0 (/Users/boppy/clockwork/workspace3/SpacetimeDB/crates/cli)` (executable `spacetime`

Incremental speedup: ~2 minutes

API

  • This is a breaking change to the module API
  • This is a breaking change to the ClientAPI

If the API is breaking, please state below what will break

@jdetter jdetter marked this pull request as ready for review July 1, 2023 17:48
Copy link
Contributor

@gefjon gefjon left a comment

Choose a reason for hiding this comment

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

This seems like a good change. I'd be interested to know if opt-level = 2 changes either build time or runtime performance significantly, but I don't want to get drawn too far down the rabbit hole of adjusting all of the various knobs.

@jdetter
Copy link
Collaborator Author

jdetter commented Jul 1, 2023

This seems like a good change. I'd be interested to know if opt-level = 2 changes either build time or runtime performance significantly, but I don't want to get drawn too far down the rabbit hole of adjusting all of the various knobs.

I tried it and it only really took off a few seconds, it didn't really seem like it made as substantial of a difference as changing the link time optimizations.

@jdetter jdetter enabled auto-merge (squash) July 1, 2023 19:14
@jdetter jdetter merged commit 6b0967b into master Jul 1, 2023
cloutiertyler pushed a commit that referenced this pull request Aug 1, 2023
* Cargo profile for building more quickly

* opt level is redundant

---------

Co-authored-by: Boppy <no-reply@boppygames.gg>
cloutiertyler pushed a commit that referenced this pull request Aug 1, 2023
* Cargo profile for building more quickly

* opt level is redundant

---------

Co-authored-by: Boppy <no-reply@boppygames.gg>
@cloutiertyler cloutiertyler deleted the jdetter/faster-cargo-build-for-cli branch August 1, 2023 21:53
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