Skip to content
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] - [ecs] Improve Commands performance #2332

Closed
Closed
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
3bf9f6c
[ecs] Do not allocate each `Command`
NathanSWard Jun 9, 2021
2654470
fix doc typo
NathanSWard Jun 11, 2021
e0c6f83
reduce unsafe code, and remove alignment requirements
NathanSWard Jun 12, 2021
0578d09
doc typos
NathanSWard Jun 12, 2021
bda5cac
move anystack to implementation detail. rename to command-queue-inner
NathanSWard Jun 13, 2021
af29f6c
remove remaining anystack files
NathanSWard Jun 13, 2021
2065293
remove unused functions
NathanSWard Jun 13, 2021
30c47bd
fix new function to default
NathanSWard Jun 13, 2021
453a93e
fix tests
NathanSWard Jun 13, 2021
a8f4747
update docs/comments
NathanSWard Jun 13, 2021
3d45f1d
fix comment typo
NathanSWard Jun 14, 2021
31f90d9
add special case for 0 sized commands
NathanSWard Jun 15, 2021
abb04a8
fix issues with possible reading from null-ptr
NathanSWard Jun 15, 2021
c3080cf
0-sized struct optimization
NathanSWard Jun 15, 2021
0975f63
add test that checks if commands implement 'Send'
NathanSWard Jun 16, 2021
2a7940b
fix CommandQueueInner not being panic safe
NathanSWard Jun 16, 2021
90bc0bb
reuse bytes vector allocations
NathanSWard Jun 16, 2021
b15ce06
prevent possilbe UB with set_len and adding to a null pointer
NathanSWard Jun 17, 2021
72f230c
address review comments
NathanSWard Jun 18, 2021
aa60572
directly use CommandQueueInner as CommandQueue
NathanSWard Jun 20, 2021
3b706a8
remember to flush world
NathanSWard Jun 20, 2021
e88f779
typo
NathanSWard Jun 20, 2021
217e277
re-trigger ci
NathanSWard Jun 20, 2021
a9be103
fix typo
NathanSWard Jun 21, 2021
09ccbc0
update commands perf test impl
NathanSWard Jul 16, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
remember to flush world
  • Loading branch information
NathanSWard committed Jul 16, 2021
commit 3b706a81c770bc52e05f0560b9621c2fc8d00af6
3 changes: 3 additions & 0 deletions crates/bevy_ecs/src/system/commands/command_queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ impl CommandQueue {
/// This clears the queue.
#[inline]
pub fn apply(&mut self, world: &mut World) {
// flush previouly queued entities
world.flush();

// SAFE: In the iteration below, `meta.func` will safely consume and drop each pushed command.
// This operation is so that we can reuse the bytes `Vec<u8>`'s internal storage and prevent
// unnecessary allocations.
Expand Down