[*] cache these adapter allocations away
This commit is contained in:
parent
30b0c2e0ba
commit
3f0368b99d
@ -402,7 +402,12 @@ namespace Aurora::IO::Protocol
|
||||
return {};
|
||||
}
|
||||
|
||||
return AuMakeShared<AuIO::Buffered::BlobWriter>(this->pSourceBufer);
|
||||
if (this->pStreamWriterCache)
|
||||
{
|
||||
return this->pStreamWriterCache;
|
||||
}
|
||||
|
||||
return this->pStreamWriterCache = AuMakeShared<AuIO::Buffered::BlobWriter>(this->pSourceBufer);
|
||||
}
|
||||
|
||||
AuSPtr<Memory::ByteBuffer> ProtocolStack::AsWritableByteBuffer()
|
||||
@ -423,7 +428,12 @@ namespace Aurora::IO::Protocol
|
||||
return {};
|
||||
}
|
||||
|
||||
return AuMakeShared<AuIO::Buffered::BlobReader>(pBuffer);
|
||||
if (this->pStreamReaderCache)
|
||||
{
|
||||
return this->pStreamReaderCache;
|
||||
}
|
||||
|
||||
return this->pStreamReaderCache = AuMakeShared<AuIO::Buffered::BlobReader>(pBuffer);
|
||||
}
|
||||
|
||||
AuSPtr<Memory::ByteBuffer> ProtocolStack::AsReadableByteBuffer()
|
||||
|
@ -51,5 +51,8 @@ namespace Aurora::IO::Protocol
|
||||
|
||||
AuWPtr<AuIO::IOPipeWork> pPipeWork;
|
||||
bool bKillPipeOnFirstRootLevelFalse {};
|
||||
|
||||
AuSPtr<IStreamReader> pStreamReaderCache;
|
||||
AuSPtr<IStreamWriter> pStreamWriterCache;
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue
Block a user