Description
In ironoxide, we currently have 3 profile sections: [profile.dev]
, [profile.test]
, and [profile.release]
. We have changed the default opt-level for dev and test to be 2.
I would advocate for setting dev back to 0 in order to allow for fast compilation by RLS while writing new code.
The problem with this is that I believe that [profile.test]
is not working as documented. It appears that tests takes the optimization from [profile.dev]
instead.
Running time cargo t
after already compiling with cargo t --no-run
, I get the following:
dev opt-level | test opt-level | test time |
---|---|---|
2 | 2 | 25s |
0 | 2 | 90s |
This suggests that test's opt-level is not respected.
I have seen threads (from years ago) where people suggest that [profile.test]
and [profile.bench]
be deprecated, as they argue that it should simply inherit from [profile.dev]
and [profile.release]
, respectively, but I haven't seen mention of that happening, and the current docs still mention those sections.
In spite of all this, I would suggest the following:
- Set dev's opt-level to its default (0)
- Remove the
[profile.test]
section as I find it misleading - Use
cargo t
for general testing, andcargo t --release
when speed is a factor