hashgraph / hashgraph/pbj

Improve performance: WritableStreamingData.writeBytes(ByteBuffer)

Open
#199 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 `WritableStreamingData.writeBytes(ByteBuffer)` method is only optimal when the input `ByteBuffer.hasArray()` is true. Otherwise it delegates to the parent interface where the implementation runs a loop for each individual byte, which is slow.

Find a way to optimize the implementation for buffers that don't have arrays (perhaps using `Unsafe` methods or similar.)

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.