Skip to content

Optimise firstMatching by reducing allocations#6908

Merged
neilalexander merged 1 commit intomainfrom
neil/firstmatching2
May 20, 2025
Merged

Optimise firstMatching by reducing allocations#6908
neilalexander merged 1 commit intomainfrom
neil/firstmatching2

Conversation

@neilalexander
Copy link
Copy Markdown
Member

This improves firstMatching by simplifying the wildcard vs non-wildcard logic and removing a substantial number of allocations by no longer collecting subs. This results in quite a notable performance improvement and reduced GC pressure when checking interest state etc.

Signed-off-by: Neil Twigg neil@nats.io

Signed-off-by: Neil Twigg <neil@nats.io>
@neilalexander neilalexander requested a review from a team as a code owner May 20, 2025 12:40
Copy link
Copy Markdown
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.

LGTM

@neilalexander neilalexander merged commit 3ccb5d1 into main May 20, 2025
69 of 70 checks passed
@neilalexander neilalexander deleted the neil/firstmatching2 branch May 20, 2025 13:31
neilalexander added a commit that referenced this pull request May 20, 2025
Includes the following:

- #6895
- #6899
- #6900
- #6908

Signed-off-by: Neil Twigg <neil@nats.io>
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