bevy/examples/stress_tests
ickshonpe 6f7d0e5725
split up TextStyle (#15857)
# Objective

Currently text is recomputed unnecessarily on any changes to its color,
which is extremely expensive.

## Solution
Split up `TextStyle` into two separate components `TextFont` and
`TextColor`.

## Testing

I added this system to `many_buttons`:
```rust
fn set_text_colors_changed(mut colors: Query<&mut TextColor>) {
    for mut text_color in colors.iter_mut() {
        text_color.set_changed();
    }
}
```

reports ~4fps on main, ~50fps with this PR.

## Migration Guide
`TextStyle` has been renamed to `TextFont` and its `color` field has
been moved to a separate component named `TextColor` which newtypes
`Color`.
2024-10-13 17:06:22 +00:00
..
bevymark.rs split up TextStyle (#15857) 2024-10-13 17:06:22 +00:00
many_animated_sprites.rs Migrate bevy_sprite to required components (#15489) 2024-10-09 16:17:26 +00:00
many_buttons.rs split up TextStyle (#15857) 2024-10-13 17:06:22 +00:00
many_cubes.rs Migrate cameras to required components (#15641) 2024-10-05 01:59:52 +00:00
many_foxes.rs Replace Handle<AnimationGraph> component with a wrapper (#15742) 2024-10-08 22:41:24 +00:00
many_gizmos.rs Text rework (#15591) 2024-10-09 18:35:36 +00:00
many_glyphs.rs split up TextStyle (#15857) 2024-10-13 17:06:22 +00:00
many_lights.rs Migrate cameras to required components (#15641) 2024-10-05 01:59:52 +00:00
many_sprites.rs Migrate bevy_sprite to required components (#15489) 2024-10-09 16:17:26 +00:00
README.md
text_pipeline.rs split up TextStyle (#15857) 2024-10-13 17:06:22 +00:00
transform_hierarchy.rs Deprecate get_or_spawn (#15652) 2024-10-07 16:08:22 +00:00
warning_string.txt

Stress tests

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

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