Skip to content

Do not clone callbacks Set unless there is attempt to modify it #1

@Maksims

Description

@Maksims

For efficiency on memory, is is important to avoid allocations as much as possible.
Currently there is allocation (copy of a Set) on each emit of callback.
It is possible to do copy of Set only if there is any attempt to modify it during callback execution. In majority of cases this will avoid allocation, for the small cost of CPU for checks on modification attempts.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions