diff options
| author | Dan Engelbrecht <[email protected]> | 2024-03-14 16:50:18 +0100 |
|---|---|---|
| committer | GitHub Enterprise <[email protected]> | 2024-03-14 16:50:18 +0100 |
| commit | 0a935231009cb21680d364ef125f0296a5a5bed6 (patch) | |
| tree | 7e55a67ae60883b0eab71a0d636aeec23f307d14 /src/zencore/blake3.cpp | |
| parent | clean up test linking (#4) (diff) | |
| download | zen-0a935231009cb21680d364ef125f0296a5a5bed6.tar.xz zen-0a935231009cb21680d364ef125f0296a5a5bed6.zip | |
special treatment large oplog attachments v2 (#5)
- Bugfix: Install Ctrl+C handler earlier when doing `zen oplog-export` and `zen oplog-export` to properly cancel jobs
- Improvement: Add ability to block a set of CAS entries from GC in project store
- Improvement: Large attachments and loose files are now split into smaller chunks and stored in blocks during oplog export
Diffstat (limited to 'src/zencore/blake3.cpp')
| -rw-r--r-- | src/zencore/blake3.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/zencore/blake3.cpp b/src/zencore/blake3.cpp index bdbc8fb3e..e4edff227 100644 --- a/src/zencore/blake3.cpp +++ b/src/zencore/blake3.cpp @@ -45,14 +45,15 @@ BLAKE3::HashBuffer(const CompositeBuffer& Buffer) for (const SharedBuffer& Segment : Buffer.GetSegments()) { - size_t SegmentSize = Segment.GetSize(); - if (SegmentSize >= (65536 + 32768) && Segment.IsFileReference()) + size_t SegmentSize = Segment.GetSize(); + static const size_t BufferingSize = 512 * 1024; + if (SegmentSize >= (BufferingSize + BufferingSize / 2) && Segment.IsFileReference()) { const IoBuffer SegmentBuffer = Segment.AsIoBuffer(); size_t Offset = 0; while (Offset < SegmentSize) { - size_t ChunkSize = Min<size_t>(SegmentSize - Offset, 65536u); + size_t ChunkSize = Min<size_t>(SegmentSize - Offset, BufferingSize); IoBuffer SubRange(SegmentBuffer, Offset, ChunkSize); blake3_hasher_update(&Hasher, SubRange.GetData(), ChunkSize); Offset += ChunkSize; |