[ 
https://issues.apache.org/jira/browse/RATIS-2027?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Duong updated RATIS-2027:
-------------------------
    Description: 
In ratis streaming, the write to RemoteStream uses ByteBuf#nioBuffer() which 
copies the ByteBuf content to a HeapByteBuffer.
{code:java}
CompletableFuture<DataStreamReply> write(DataStreamRequestByteBuf request, 
Executor executor) {
  final Timekeeper.Context context = metrics.start();
  return composeAsync(sendFuture, executor,
      n -> out.writeAsync(request.slice().nioBuffer(), 
addFlush(request.getWriteOptionList()))
          .whenComplete((l, e) -> metrics.stop(context, e == null)));
} {code}
And this action create 2 points of inefficiencies:

 

  was:
In ratis streaming, the write to RemoteStream uses ByteBuf#nioBuffer() which 
copy the ByteBuf 
{code:java}
CompletableFuture<DataStreamReply> write(DataStreamRequestByteBuf request, 
Executor executor) {
  final Timekeeper.Context context = metrics.start();
  return composeAsync(sendFuture, executor,
      n -> out.writeAsync(request.slice().nioBuffer(), 
addFlush(request.getWriteOptionList()))
          .whenComplete((l, e) -> metrics.stop(context, e == null)));
} {code}


> Ratis Streaming: Remote Stream copy data to heap
> ------------------------------------------------
>
>                 Key: RATIS-2027
>                 URL: https://issues.apache.org/jira/browse/RATIS-2027
>             Project: Ratis
>          Issue Type: Improvement
>          Components: Streaming
>            Reporter: Duong
>            Priority: Major
>              Labels: performance
>         Attachments: allocation.png, cpu.png, dn_write_streaming.htm, 
> dn_write_streaming_allocation.htm
>
>
> In ratis streaming, the write to RemoteStream uses ByteBuf#nioBuffer() which 
> copies the ByteBuf content to a HeapByteBuffer.
> {code:java}
> CompletableFuture<DataStreamReply> write(DataStreamRequestByteBuf request, 
> Executor executor) {
>   final Timekeeper.Context context = metrics.start();
>   return composeAsync(sendFuture, executor,
>       n -> out.writeAsync(request.slice().nioBuffer(), 
> addFlush(request.getWriteOptionList()))
>           .whenComplete((l, e) -> metrics.stop(context, e == null)));
> } {code}
> And this action create 2 points of inefficiencies:
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to