mirror of
https://github.com/ZoneTree/ZoneTree.git
synced 2026-10-29 13:37:47 +08:00
Drop bottom segments properly. Set Brotli Optimum = Fastest.
This commit is contained in:
@@ -6,6 +6,10 @@ public static class BrotliDataCompression
|
||||
{
|
||||
public static byte[] Compress(Span<byte> span, int level)
|
||||
{
|
||||
/// Brotli Optimum level is extremely slow.
|
||||
/// Changing the optimum level to fastest!
|
||||
if (level == 0)
|
||||
level = 1;
|
||||
using var msOutput = new MemoryStream();
|
||||
using var gzs = new BrotliStream(msOutput, (CompressionLevel)level, false);
|
||||
gzs.Write(span);
|
||||
|
||||
@@ -227,7 +227,7 @@ public sealed partial class ZoneTree<TKey, TValue> : IZoneTree<TKey, TValue>, IZ
|
||||
foreach (var ros in readOnlySegments)
|
||||
ros.Drop();
|
||||
foreach (var bs in BottomSegmentQueue.ToArray())
|
||||
bs.ReleaseResources();
|
||||
bs.Drop();
|
||||
Options.WriteAheadLogProvider.DropStore();
|
||||
Options.RandomAccessDeviceManager.DropStore();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user