Skip to content

Allow opt-in configuration of events to use SmallVec #2071

@alice-i-cecile

Description

@alice-i-cecile

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

Events inherently have variable size. This can cause weirdness with cache locality, particularly when they're stored on components ala what is being proposed in #2070.

What solution would you like?

Provide an ergonomic way to specify that the internal representation of events use a SmallVec of configurable size.

This is particularly relevant for the use case in #2070, where many uses of this pattern will store 0-2 events in 99% of cases.

What alternative(s) have you considered?

None.

Additional context

This idea came up in discussion with @TheRawMeatball.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ECSEntities, components, systems, and eventsC-FeatureA new feature, making something new possibleC-PerformanceA change motivated by improving speed, memory usage or compile times

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions