Skip to content

Commit

Permalink
Compile insta and similar in opt mode for faster testing
Browse files Browse the repository at this point in the history
This is recommended by the insta documentation.
See: https://docs.rs/insta/latest/insta/#optional-faster-runs.

Running on an M1 MacBook Pro

Before:
```
________________________________________________________
Executed in   31.10 secs    fish           external
   usr time  118.87 secs  107.00 micros  118.87 secs
   sys time   46.19 secs  847.00 micros   46.19 secs
```

After:
```
________________________________________________________
Executed in   29.73 secs    fish           external
   usr time  119.58 secs    0.13 millis  119.58 secs
   sys time   46.27 secs    1.74 millis   46.27 secs
```

This doesn't seem like a huge change, and there's noise in the measurements,
but I don't think it can hurt and insta recommends it.
  • Loading branch information
emesterhazy committed Feb 15, 2024
1 parent e9fc8d4 commit a9278f5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,12 @@ zstd = "0.12.4"
jj-lib = { path = "lib", version = "0.14.0" }
testutils = { path = "lib/testutils" }

# Insta suggests compiling these packages in opt mode for faster testing.
# See https://docs.rs/insta/latest/insta/#optional-faster-runs.
[profile.dev.package]
insta.opt-level = 3
similar.opt-level = 3

[profile.release]
strip = "debuginfo"
codegen-units = 1

0 comments on commit a9278f5

Please sign in to comment.