Add BufferedMurmur3Hasher to reduce allocations when hashing Strings#133226
Merged
felixbarny merged 12 commits intoelastic:mainfrom Aug 22, 2025
Merged
Add BufferedMurmur3Hasher to reduce allocations when hashing Strings#133226felixbarny merged 12 commits intoelastic:mainfrom
felixbarny merged 12 commits intoelastic:mainfrom
Conversation
3 tasks
Collaborator
|
Pinging @elastic/es-storage-engine (Team:StorageEngine) |
kkrik-es
reviewed
Aug 22, 2025
| */ | ||
| public class BufferedMurmur3Hasher extends Murmur3Hasher { | ||
|
|
||
| public static final int DEFAULT_BUFFER_SIZE = 32 * 4; // 32 characters, each character may take up to 4 bytes in UTF-8 |
Contributor
There was a problem hiding this comment.
Maybe 128 * 4 to play it safe?
Member
Author
There was a problem hiding this comment.
As this is the default size, I'd like to be a bit more conservative with memory usage. This should probably also be enough for the OTLP endpoint as this is used primarily for attribute names. The attribute values are already in utf8-encoded byte arrays and directly use the update method.
kkrik-es
reviewed
Aug 22, 2025
server/src/test/java/org/elasticsearch/common/hash/BufferedMurmur3HasherTests.java
Outdated
Show resolved
Hide resolved
kkrik-es
approved these changes
Aug 22, 2025
Co-authored-by: Kostas Krikellas <131142368+kkrik-es@users.noreply.github.com>
Member
Author
|
I've made another change to reduce the number of flushes. This should yield more throughput in the hasher as the amount of data it can hash at once is larger. |
pabloem
pushed a commit
to pabloem/elasticsearch
that referenced
this pull request
Aug 22, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #132566