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

Improve PbjBytesHasher to reduce garbage #14771

Closed
jasperpotts opened this issue Aug 9, 2024 · 2 comments
Closed

Improve PbjBytesHasher to reduce garbage #14771

jasperpotts opened this issue Aug 9, 2024 · 2 comments

Comments

@jasperpotts
Copy link
Member

Problem

PbjBytesHasher when hashing protobuf objects it is inefficient as it has to go form PBJ protobuf object to byte[] then to MessageDigest.

Solution

PBJ serialization is stream based and so is MessageDigest. We just need to connect them together. I have filled a PBJ enhancement to add convenience method to make this easy. Once that is implemented then PbjBytesHasher can be updated to use it.
See hashgraph/pbj#271
Also as a side note PbjBytesHasher is not the most obvious name as it is very generic, PbjEventHasher would be better 😀

Alternatives

No response

@lpetrovic05
Copy link
Member

PbjBytesHasher is not currently being used, because it was replaced in develop by PbjStreamHasher that does not create a byte[] as an intermediary. So I think we can close this ticket

@poulok poulok closed this as completed Aug 14, 2024
@poulok poulok reopened this Aug 14, 2024
@lpetrovic05
Copy link
Member

outdated, closing

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

No branches or pull requests

3 participants