-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
[Merged by Bors] - Optimize rendering slow-down at high entity counts #5509
Closed
TheRawMeatball
wants to merge
13
commits into
bevyengine:main
from
TheRawMeatball:optimize-large-entity-counts
Closed
Changes from 10 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
dcaefaf
better flush
TheRawMeatball aeb5230
more docs
TheRawMeatball a5f8c03
Add assert for added safety
TheRawMeatball a745ad6
switch to ridiculously fast memset
TheRawMeatball 9b0e298
fix docs
TheRawMeatball 9f106d8
final fixes
TheRawMeatball e283fc6
mirror safety comment on EntityMeta
TheRawMeatball 8a32577
add repr C
TheRawMeatball becb9e7
add DO_UB flag
TheRawMeatball b02a1d7
fix ub
TheRawMeatball e8be324
revert example
TheRawMeatball d500cbe
add safety comment.
TheRawMeatball 2fea9ed
Merge remote-tracking branch 'origin/main' into pr/TheRawMeatball/5509
cart File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,37 @@ | ||
use bevy::prelude::*; | ||
TheRawMeatball marked this conversation as resolved.
Show resolved
Hide resolved
|
||
use bevy::{ | ||
diagnostic::{FrameTimeDiagnosticsPlugin, LogDiagnosticsPlugin}, | ||
prelude::*, | ||
}; | ||
|
||
fn main() { | ||
App::new().add_system(hello_world_system).run(); | ||
#[derive(Component)] | ||
pub struct Nothing; | ||
|
||
#[derive(Bundle)] | ||
pub struct NoBundle { | ||
nothing: Nothing, | ||
} | ||
|
||
fn startup(mut commands: Commands) { | ||
let mut entities = Vec::new(); | ||
for _ in 0..40_000_000 { | ||
entities.push(NoBundle { nothing: Nothing }); | ||
} | ||
|
||
commands.spawn_batch(entities); | ||
} | ||
|
||
fn hello_world_system() { | ||
println!("hello world"); | ||
fn main() { | ||
App::new() | ||
.insert_resource(WindowDescriptor { | ||
width: 1270.0, | ||
height: 720.0, | ||
title: String::from("Bug"), | ||
..Default::default() | ||
}) | ||
.insert_resource(ClearColor(Color::rgb(0.211, 0.643, 0.949))) | ||
.add_plugin(FrameTimeDiagnosticsPlugin::default()) | ||
.add_plugin(LogDiagnosticsPlugin::default()) | ||
.add_plugins(DefaultPlugins) | ||
.add_startup_system(startup) | ||
.run(); | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably makes sense to add a comment to
ArchetypeId::INVALID
saying that it must be equivalent to setting all bytes of memory tou8::MAX
(and referencing flush_and_reserve_invalid). Don't want anyone changing this here and then implicitly breaking flush_and_reserve_invalid.