hashgraph / hashgraph/pbj

Improve performance: *BufferedData.writeBytes(RandomAccessData)

Open
#202 0 comments 0 reactions 0 assignees View on GitHub
Good First Issue
Dominant language
Java
Stars
44
Forks
15
Avg merge
1d 15h
Merged PRs (30d)
12

Description

The `*BufferedData.writeBytes(RandomAccessData)` methods are only optimal when the input is an instance of the `Bytes` class, delegating to the super interface otherwise where the implementation is slow. While, apart from the `Bytes`, it's only the `*BufferedData` classes themselves that implement the `RandomAccessData` interface and there's dedicated `writeBytes(BufferedData)` methods, one can still manage to cast the BufferedData to the RandomAccessData and end up calling the not-optimized version of the method.

Make sure that any existing implementation of the `RandomAccessData` interface goes through a fast path when calling the `*BufferedData.writeBytes(RandomAccessData)` method.

For more details, see https://github.com/hashgraph/pbj/issues/191

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.