Drop bottom segments properly. Set Brotli Optimum = Fastest.

This commit is contained in:
Ahmed Yasin Koculu
2022-08-30 00:55:57 +02:00
parent a546aa3a2e
commit 1270566871
2 changed files with 5 additions and 1 deletions
@@ -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);
+1 -1
View File
@@ -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();
}