apache / apache/arrow-java

ArrowBuf copying from GetReadableBuffer causes slowness

Open
#835 2 comments 0 reactions 0 assignees View on GitHub
Type: usage
Dominant language
Java
Stars
94
Forks
152
Avg merge
3d 16h
Merged PRs (30d)
11

Description

### Describe the usage question you have. Please include as many useful details as possible.

I'm using Arrow Flight and discovered an extra copy action while testing performance impact.

` ReadableBuffer readableBuffer = fastPath ? getReadableBuffer(stream) : null;
if (readableBuffer != null) {
readableBuffer.readBytes(buf.nioBuffer(0, size));
} `

Image

The flame graph shows that after enabling zero_copy, ArrowBuf copying from GetReadableBuffer causes slowness.
Why does this copy occur?
Or is it because arrowbuf needs to manage its own memory, so the ownership must be transferred from netty?

### Component(s)

FlightRPC

Contributor guide

Open the contributing guide

Research direction

Start with the FlightRPC fast path shown in the issue, following getReadableBuffer through ReadableBuffer.readBytes and the ArrowBuf destination while comparing the reported flame graph. Determine whether the copy is required for ownership or memory management, and document the cause or a clearly supported way to avoid it.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.