#bevy_rapier `parallel` and `simd-stable` features result in worse performance

9 messages · Page 1 of 1 (latest)

vernal drum
#

I am creating a game and am getting some very annoying stuttering, the stutters are quite short but still very noticeable. How can I go about debugging this, is there a way to see what systems are taking the most time? I have attached a graph showing the frame times I have collected.

This is how I am testing

#[derive(Resource, Default, Debug)]
struct FrameTimes(Vec<f32>);

fn log_frame_times(mut frame_times: ResMut<FrameTimes>, time: Res<Time>, keys: Res<Input<KeyCode>>) {
    frame_times.0.push(time.delta_seconds());
    if keys.just_pressed(KeyCode::F1) {
        let _ = std::fs::write("frame_times.txt", format!("{:#?}", frame_times.0));
    }
}
#

Please let me know is there is any more data I could collect to assist with this

#

I am using bevy_rapier3d with quite a lot of physics objects (51 vehicles * 5 rigidbodys per vehicle) but even with only 1 vehicle (the player), I still get stuttering

#

When I disable bevy_rapier's simd-stable feature i get this

#

This is without the parallel feature

#

And I think I found my issue, I ran this test over a much longer time period (the first run was the same so i ran the longer one) and got only a single stutter that still isn't even noticeable, why is it that parallel and simd-stable result in worse performance?

#

I cranked it back up to 51 vehicles (all of the pervious except for the first one only have 1) and the same thing, only one spike that is still only 4.5 milliseconds, more than fast enough for a good framerate

#

bevy_rapier parallel and simd-stable features result in worse performance

cursive basin