Skip to content

Commit

Permalink
5x faster unit test compilation on nix dev env (#467)
Browse files Browse the repository at this point in the history
* 5x faster unit test compilation

Both on a warm cache running the command:
time cargo test test_pk_recovery

Before:
cargo test test_pk_recovery  635.13s user 26.51s system 679% cpu 1:37.38 total

After:
cargo test test_pk_recovery  45.39s user 11.66s system 280% cpu 20.361 total

I should probably find out why our compile cache keeps getting
invalidated, but this is a quick win. Cost is this adds in a new native dependency.

* Actually let's just keep this in the nix dev env
  • Loading branch information
DavidM-D authored Feb 20, 2024
1 parent 0b90387 commit 2f337f1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@
in {
devShell = pkgs.mkShell {

env = {
SCCACHE_GHA_ENABLED = true;
RUSTC_WRAPPER = "sccache";
};

# Everything in this list is added to your path
buildInputs =
with pkgs;
Expand All @@ -30,6 +35,7 @@
# Development
cargo-watch
cargo-audit
sccache
] ++

pkgs.lib.optionals pkgs.stdenv.isDarwin
Expand Down

0 comments on commit 2f337f1

Please sign in to comment.