Skip to content

Commit

Permalink
Add a stress test profile (#6901)
Browse files Browse the repository at this point in the history
# Objective
This adds a custom profile for testing against stress tests. Bevy seemingly gets notably faster with LTO turned on. To more accurately depict production level performance, LTO and other rustc-level optimizations should be enabled when performance testing on stress tests.

Also updated the stress test docs to reflect that users should be using it.
  • Loading branch information
james7132 committed Dec 20, 2022
1 parent bd615cb commit 5b8b7dc
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -1608,3 +1608,8 @@ inherits = "release"
opt-level = "z"
lto = "fat"
codegen-units = 1

[profile.stress-test]
inherits = "release"
lto = "fat"
panic = "abort"
11 changes: 10 additions & 1 deletion examples/stress_tests/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# Stress tests

These examples are used to stress test Bevy's performance in various ways. These should be run with the --release argument to cargo or equivalent optimization, otherwise they will be very slow.
These examples are used to stress test Bevy's performance in various ways. These
should be run with the "stress-test" profile to accurately represent performance
in production, otherwise they will run in cargo's default "dev" profile which is
very slow.

## Example Command

```bash
cargo run --profile stress-test --example <EXAMPLE>
```

0 comments on commit 5b8b7dc

Please sign in to comment.