Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions cloud/filestore/libs/storage/service/service_actor_readdata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,15 +196,18 @@ TReadDataActor::TReadDataActor(

void TReadDataActor::Bootstrap(const TActorContext& ctx)
{
if (ReadRequest.GetIovecs().empty()) {
// BlockBuffer should not be initialized in constructor, because
// creating a block buffer leads to memory allocation (and
// initialization) which is heavy and we would like to execute that on a
// separate thread (instead of this actor's parent thread)
BlockBuffer->ReserveAndResize(ReadRequest.GetLength());
TargetBuffers = CreateRope(BlockBuffer->begin(), BlockBuffer->size());
} else {
TargetBuffers = CreateRope(ReadRequest.GetIovecs());
if (UseTwoStageRead) {
if (ReadRequest.GetIovecs().empty()) {
// BlockBuffer should not be initialized in constructor, because
// creating a block buffer leads to memory allocation (and
// initialization) which is heavy and we would like to execute that
// on a separate thread (instead of this actor's parent thread)
BlockBuffer->ReserveAndResize(ReadRequest.GetLength());
TargetBuffers =
CreateRope(BlockBuffer->begin(), BlockBuffer->size());
} else {
TargetBuffers = CreateRope(ReadRequest.GetIovecs());
}
}

// Registering InFlightRequest here for the same reason - it's quite
Expand Down
Loading