From 100c8f966b1c5b2fb190748f0177600562d1c5fe Mon Sep 17 00:00:00 2001 From: Dan Engelbrecht Date: Wed, 7 Dec 2022 11:21:41 +0100 Subject: optimizations (#200) * Use direct file read and direct buffer allocation for small IoBuffer materalization * Reduce range of materialized data in CompositeBuffer reading CompressedBuffer header reading often only need a small part and not the whole file * reduce lock contention in IoBuffer::Materialize * Reduce parsing of compressed headers Validate header type at decompression * faster CreateDirectories - start from leaf going up and recurse back * optimized BufferHeader::IsValid * Add ValidateCompressedHeader to use when we don't need the actual compressed data Validate that we always get compressed data in CidStore::AddChunk * changelog --- zenserver/testing/launch.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'zenserver/testing/launch.cpp') diff --git a/zenserver/testing/launch.cpp b/zenserver/testing/launch.cpp index 0e46fff94..b26f9e437 100644 --- a/zenserver/testing/launch.cpp +++ b/zenserver/testing/launch.cpp @@ -477,7 +477,11 @@ HttpLaunchService::HttpLaunchService(CidStore& Store, const std::filesystem::pat { std::filesystem::path FullPath = SandboxDir / FileName; - CompressedBuffer Compressed = CompressedBuffer::FromCompressed(SharedBuffer(Chunk)); + IoHash RawHash; + uint64_t RawSize; + CompressedBuffer Compressed = CompressedBuffer::FromCompressed(SharedBuffer(Chunk), RawHash, RawSize); + ZEN_ASSERT(Compressed); + ZEN_ASSERT(FileHash == RawHash); CompositeBuffer CompositeBuffer = Compressed.DecompressToComposite(); std::span Segments = CompositeBuffer.GetSegments(); std::vector Chunks(Segments.size()); -- cgit v1.2.3