You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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, and cargo t --release when speed is a factor
The text was updated successfully, but these errors were encountered:
giarc3
changed the title
Opt-level not behaving as expected
Test opt-level not behaving as expected
Jan 13, 2020
There is some possibly confusing interaction with the test/bench profile. Because dependencies are always built with the dev/release profiles, overridding test/bench usually does not have an effect (unless specifying a workspace member that is being tested/benched). Overriding test/bench was previously prohibited, but was relaxed when named profiles were added.
Stabilizing in Rust 1.41, we will be able to add a section to our Cargo.toml that looks like:
# Set the default for dependencies
[profile.dev.package."*"]
opt-level = 3
which should allow us to optimize our dependencies while lowering the opt-level for dev.
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 withcargo t --no-run
, I get the following: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:
[profile.test]
section as I find it misleadingcargo t
for general testing, andcargo t --release
when speed is a factorThe text was updated successfully, but these errors were encountered: