Skip to content

Improve pruning of expired callback groups #3463

Backlog

Description

@christophebedard

Description

Follow-up to #3437. In that PR, we made adding a new callback group also iterate through the vector of callback groups and remove the ones that are expired.

As mentioned in this comment and other comments below that one, if you have a lot of callback groups (e.g., 2000+), then adding new groups gets slower and slower.

We want to optimize this pruning. Maybe it doesn't need to run every time a callback group is added.

Motivation

Optimize.

Design / Implementation Considerations

We have not come up with a solution yet. Do not open a PR before discussing on this issue and validating a solution with the maintainers.

Whatever solution we pick should align with how we deal with other lists of objects. #3437 already aligns well with that (see comment).

One solution might be to not always iterate through the list, e.g., only when the vector is at capacity, and explicitly doubling its capacity when needed.

Additional Information

No response

Activity

  1. added
    enhancement
    on Dec 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions