Skip to content

Reuse RenderContextState and PendingCommandBuffers heap allocations#24622

Open
beicause wants to merge 3 commits into
bevyengine:mainfrom
beicause:reuse-render-context-heap-allocations
Open

Reuse RenderContextState and PendingCommandBuffers heap allocations#24622
beicause wants to merge 3 commits into
bevyengine:mainfrom
beicause:reuse-render-context-heap-allocations

Conversation

@beicause

Copy link
Copy Markdown
Member

Objective

Reuse heap allocations in RenderContext. Address #22144 (comment)

Solution

Replace core::mem::take with drain(..). Change PendingCommandBuffers::take to return an Iterator and use peek() to check if it's empty.

Testing

Examples still work

@kfc35 kfc35 added A-Rendering Drawing game state to the screen C-Performance A change motivated by improving speed, memory usage or compile times labels Jun 14, 2026
@github-project-automation github-project-automation Bot moved this to Needs SME Triage in Rendering Jun 14, 2026
@kfc35 kfc35 added S-Needs-Review Needs reviewer attention (from anyone!) to move forward D-Straightforward Simple bug fixes and API improvements, docs, test and examples labels Jun 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Rendering Drawing game state to the screen C-Performance A change motivated by improving speed, memory usage or compile times D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Needs-Review Needs reviewer attention (from anyone!) to move forward

Projects

Status: Needs SME Triage

Development

Successfully merging this pull request may close these issues.

2 participants