Skip to content

Expose more of the Vec API on BufferVec #3531

@james7132

Description

@james7132

What problem does this solve or what need does it fill?

More efficient mutation APIs for BufferVec than just push, reserve, and clear. Repeatedly pushing large quantities can be quite inefficient due to needing to repeatedly do size and capacity checks on the underlying Vec.

What solution would you like?

Expose more of the mutation APIs to more efficiently build BufferVecs. Most notably append for grouping chains of Vecs together.

What alternative(s) have you considered?

  • Repeatedly pushing the items onto the BufferVec.
  • DerefMut on the underlying Vec.

Additional context

This would both simplify and speed up the "prepare" stage of rendering of entities with large quantities of mutable values, including but not limited to particle systems and large scale batching.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-RenderingDrawing game state to the screenC-FeatureA new feature, making something new possibleC-UsabilityA targeted quality-of-life change that makes Bevy easier to useD-TrivialNice and easy! A great choice to get started with Bevy

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions