Improve performance: *BufferedData.writeBytes(RandomAccessData)
- 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
Assessment
This issue has not been assessed yet.