Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consumer signalling using generic sublist #6499

Merged
merged 2 commits into from
Feb 12, 2025
Merged

Conversation

neilalexander
Copy link
Member

This PR adds a new GenericSublist, which is based on the existing sublist, but with the following changes:

  • No queue semantics — they are not necessary for straight-forward matching of generic objects;
  • No cache — at the scale at which this produces a difference, none of the cache entries survive long enough, resulting in endless churn;
  • No SublistResult allocations — the match function instead takes a callback, like SubjectTree does, making it effectively zero-allocation to use.

It also moves the stream mset.csl for filtered consumers over to the new generic sublist, such that consumer signalling for new messages and/or storage updates only touches interested consumers rather than all of them. This reduces CPU dramatically when there are a very large number of consumers on a stream with mostly sparse or non-overlapping interest.

Signed-off-by: Neil Twigg [email protected]

@derekcollison
Copy link
Member

Nice improvement. For the CSL, I think a cache could help quite a bit, but maybe not L2 inside sublist but like we do for clients and the lock free L1..

Copy link
Member

@derekcollison derekcollison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general LGTM

@neilalexander neilalexander marked this pull request as ready for review February 12, 2025 10:59
@neilalexander neilalexander requested a review from a team as a code owner February 12, 2025 10:59
@neilalexander
Copy link
Member Author

Have ported over relevant sublist tests and also rebased, so ready for final review & merge.

I can look at the idea of an L2 cache separately, but at the moment the current benchmarks don't show this as performing any worse than the current code does even without it.

@derekcollison derekcollison merged commit c5423fe into main Feb 12, 2025
5 checks passed
@derekcollison derekcollison deleted the neil/consumergsl branch February 12, 2025 16:34
neilalexander added a commit that referenced this pull request Feb 12, 2025
Includes the following:

- #6492
- #6494
- #6498
- #6500
- #6499
- #6502

Signed-off-by: Neil Twigg <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants