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

Maybe use --release by default #63

Closed
sourcefrog opened this issue Aug 7, 2022 · 1 comment
Closed

Maybe use --release by default #63

sourcefrog opened this issue Aug 7, 2022 · 1 comment
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers performance Making cargo mutants faster

Comments

@sourcefrog
Copy link
Owner

cargo mutants does many incremental builds and test runs. In most trees, most of the time is spent running the tests.

Tests will typically run faster with --release; in some crates it will be much faster.

So that should at least be an option (#59) but according to the principle of "make it easy" perhaps --release should be the default.

There are at least two potential downsides:

  1. Conceivably in some trees the performance hit from doing the initial and incremental builds in release mode will outweigh the benefit of the tests being faster. However, even if that is true sometimes it's probably a win across most trees.
  2. Some projects might have test suites that are less rigorous, or simply don't work properly, in release mode. For example they might rely on debug_assert to catch some bugs. I think this would be an unidiomatic use of Rust, but it might well happen.

I think those could both reasonably be handled by having an option to go back to debug builds.

@sourcefrog sourcefrog added enhancement New feature or request good first issue Good for newcomers performance Making cargo mutants faster labels Aug 7, 2022
@sourcefrog sourcefrog self-assigned this Aug 7, 2022
@sourcefrog
Copy link
Owner Author

It will probably help on some crates, but I'm not sure it's a good default. Some crates like time take a long time to compile and link with --release, and have relatively quick test suites. Probably better to leave this to the user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers performance Making cargo mutants faster
Projects
None yet
Development

No branches or pull requests

1 participant