ArrowBuf copying from GetReadableBuffer causes slowness

Open
#835 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

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

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.

Description

Type: usage
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

Dominant language
Java
Stars
95
Forks
154
Avg merge
2d 10h
Merged PRs (30d)
11

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/arrow-java

All issues in apache/arrow-java

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.