Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

(2.14) [IMPROVED] JetStream header indexing#7454

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
MauriceVanVeen wants to merge1 commit intomain
base:main
Choose a base branch
Loading
frommaurice/hdr-fast

Conversation

@MauriceVanVeen
Copy link
Member

When ingesting messages into a JetStream stream, the speed becomes limited if headers are set on a message due to needing to do all header checks. These header checks currently continuously re-scan the headers for different keys, instead of indexing these headers once and then being able to fetch the values quickly.

This PR proposes an improvement by indexing the headers once and using that throughout for stream ingest. Using an async publish benchmark with the only header ofk: v (just to contain headers and require the server to scan even if the server doesn't need to act on them), for both R1 and R3 there's a performance improvement between 12-26%. Using a R1 withPersistMode: async (async flush) even shows a performance improvement of ~39% (915k msgs/s -> 1.3M msgs/s).

The current implementation of a pointer tojsHdrIndex, the usage ofsync.Pool and referencing[]byte was benchmarked and came out as the most performant when compared with amap to a range or[]byte, without returning a pointer, and when returning a range intohdr instead of[]byte.

Signed-off-by: Maurice van Veengithub@mauricevanveen.com

@MauriceVanVeenMauriceVanVeen marked this pull request as ready for reviewOctober 23, 2025 12:45
@MauriceVanVeenMauriceVanVeen requested a review froma team as acode ownerOctober 23, 2025 12:45
Copy link
Contributor

@sciascidsciascid left a comment

Choose a reason for hiding this comment

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

I'd love to see the getters, as mentioned in the first comment, unless you see downsides. The second comment is totally optional, and just for consideration.

Signed-off-by: Maurice van Veen <github@mauricevanveen.com>
Copy link
Contributor

@sciascidsciascid left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@sciascidsciascidsciascid approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@MauriceVanVeen@sciascid

[8]ページ先頭

©2009-2025 Movatter.jp