-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
very low performance when spawning UI nodes one inside the other #677
Comments
it seems this marks the root node as dirty at every step, which means stretch has everything to compute again. |
@cart, what did you use to create that flamegraph? Could be useful for the benchmarking stuff I'm trying to do. |
Check out our profiling doc here: https://github.com/bevyengine/bevy/blob/master/docs/profiling.md |
actually this seems related to vislyhq/stretch#71 I could reproduce by running the same calls to |
updated example: use bevy::prelude::*;
fn main() -> Result<(), Box<dyn std::error::Error>> {
App::new()
.add_plugins(DefaultPlugins)
.add_startup_system(setup)
.add_system(deep)
.run();
Ok(())
}
#[derive(Component)]
struct TickTimer(Timer);
fn setup(mut commands: Commands) {
commands.spawn_bundle(UiCameraBundle::default());
commands
.spawn_bundle(NodeBundle::default())
.insert(TickTimer(Timer::from_seconds(1., false)));
}
fn deep(mut commands: Commands, time: Res<Time>, mut query: Query<(Entity, &mut TickTimer)>) {
for (entity, mut timer) in query.iter_mut() {
if timer.0.tick(time.delta()).just_finished() {
info!("spawning new child");
let child = commands
.spawn_bundle(NodeBundle::default())
.insert(TickTimer(Timer::from_seconds(1., false)))
.id();
commands.entity(entity).push_children(&[child]);
}
}
} |
…gine#4716) # Objective DioxusLabs and Bevy have taken over maintaining what was our abandoned ui layout dependency [stretch](https://github.com/vislyhq/stretch). Dioxus' fork has had a lot of work done on it by @alice-i-cecile, @Weibye , @jkelleyrtp, @mockersf, @HackerFoo, @TimJentzsch and a dozen other contributors and now is in much better shape than stretch was. The updated crate is called taffy and is available on github [here](https://github.com/DioxusLabs/taffy) ([taffy](https://crates.io/crates/taffy) on crates.io). The goal of this PR is to replace stretch v0.3.2 with taffy v0.1.0. ## Solution I changed the bevy_ui Cargo.toml to depend on taffy instead of stretch and fixed all the errors rustc complained about. --- ## Changelog Changed bevy_ui layout dependency from stretch to taffy (the maintained fork of stretch). fixes bevyengine#677 ## Migration Guide The public api of taffy is different from that of stretch so please advise me on what to do here @alice-i-cecile.
…gine#4716) # Objective DioxusLabs and Bevy have taken over maintaining what was our abandoned ui layout dependency [stretch](https://github.com/vislyhq/stretch). Dioxus' fork has had a lot of work done on it by @alice-i-cecile, @Weibye , @jkelleyrtp, @mockersf, @HackerFoo, @TimJentzsch and a dozen other contributors and now is in much better shape than stretch was. The updated crate is called taffy and is available on github [here](https://github.com/DioxusLabs/taffy) ([taffy](https://crates.io/crates/taffy) on crates.io). The goal of this PR is to replace stretch v0.3.2 with taffy v0.1.0. ## Solution I changed the bevy_ui Cargo.toml to depend on taffy instead of stretch and fixed all the errors rustc complained about. --- ## Changelog Changed bevy_ui layout dependency from stretch to taffy (the maintained fork of stretch). fixes bevyengine#677 ## Migration Guide The public api of taffy is different from that of stretch so please advise me on what to do here @alice-i-cecile.
…gine#4716) # Objective DioxusLabs and Bevy have taken over maintaining what was our abandoned ui layout dependency [stretch](https://github.com/vislyhq/stretch). Dioxus' fork has had a lot of work done on it by @alice-i-cecile, @Weibye , @jkelleyrtp, @mockersf, @HackerFoo, @TimJentzsch and a dozen other contributors and now is in much better shape than stretch was. The updated crate is called taffy and is available on github [here](https://github.com/DioxusLabs/taffy) ([taffy](https://crates.io/crates/taffy) on crates.io). The goal of this PR is to replace stretch v0.3.2 with taffy v0.1.0. ## Solution I changed the bevy_ui Cargo.toml to depend on taffy instead of stretch and fixed all the errors rustc complained about. --- ## Changelog Changed bevy_ui layout dependency from stretch to taffy (the maintained fork of stretch). fixes bevyengine#677 ## Migration Guide The public api of taffy is different from that of stretch so please advise me on what to do here @alice-i-cecile.
…gine#4716) # Objective DioxusLabs and Bevy have taken over maintaining what was our abandoned ui layout dependency [stretch](https://github.com/vislyhq/stretch). Dioxus' fork has had a lot of work done on it by @alice-i-cecile, @Weibye , @jkelleyrtp, @mockersf, @HackerFoo, @TimJentzsch and a dozen other contributors and now is in much better shape than stretch was. The updated crate is called taffy and is available on github [here](https://github.com/DioxusLabs/taffy) ([taffy](https://crates.io/crates/taffy) on crates.io). The goal of this PR is to replace stretch v0.3.2 with taffy v0.1.0. ## Solution I changed the bevy_ui Cargo.toml to depend on taffy instead of stretch and fixed all the errors rustc complained about. --- ## Changelog Changed bevy_ui layout dependency from stretch to taffy (the maintained fork of stretch). fixes bevyengine#677 ## Migration Guide The public api of taffy is different from that of stretch so please advise me on what to do here @alice-i-cecile.
…gine#4716) # Objective DioxusLabs and Bevy have taken over maintaining what was our abandoned ui layout dependency [stretch](https://github.com/vislyhq/stretch). Dioxus' fork has had a lot of work done on it by @alice-i-cecile, @Weibye , @jkelleyrtp, @mockersf, @HackerFoo, @TimJentzsch and a dozen other contributors and now is in much better shape than stretch was. The updated crate is called taffy and is available on github [here](https://github.com/DioxusLabs/taffy) ([taffy](https://crates.io/crates/taffy) on crates.io). The goal of this PR is to replace stretch v0.3.2 with taffy v0.1.0. ## Solution I changed the bevy_ui Cargo.toml to depend on taffy instead of stretch and fixed all the errors rustc complained about. --- ## Changelog Changed bevy_ui layout dependency from stretch to taffy (the maintained fork of stretch). fixes bevyengine#677 ## Migration Guide The public api of taffy is different from that of stretch so please advise me on what to do here @alice-i-cecile.
When spawning every second a new node as a children of the last one that had been spawned, the application starts to slow down after 10 iterations, and becomes unresponsive after 15~20 iterations
with some logging and diagnostics:
the FPS starts to slow down after 10 seconds, and is false after 15 seconds as some seconds are skipped.
The text was updated successfully, but these errors were encountered: