hashgraph / hashgraph/pbj

Improve performance: ReadableSequentialData.readBytes(ByteBuffer)

Open
#203 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 `ReadableSequentialData.readBytes(ByteBuffer)` implementations have a fast path when the input buffer's `hasArray()` is true, or sometimes when the buffer `isDirect()`. Otherwise they delegate to the parent interface implementation which is slow as it runs a loop for every individual byte.

Find a way to optimize all the implementations for any type of the input buffer, perhaps using some `Unsafe` methods.

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.