@@ -48,6 +48,7 @@ public static class CompressionMetrics {
4848 }
4949
5050 private static final int MB_8 = 8 * 1024 * 1024 ;
51+
5152 private byte [] concatenateTo8mb (byte [] contentBytes ) {
5253 byte [] bytes = new byte [MB_8 + 8 ];
5354 int i = 0 ;
@@ -66,7 +67,7 @@ public void setup() throws IOException {
6667
6768 byte [] contentBytes = FSST .toBytes (content );
6869 input = concatenateTo8mb (contentBytes );
69- offsets = new int []{ 0 , MB_8 };
70+ offsets = new int [] { 0 , MB_8 };
7071 outBuf = new byte [MB_8 ];
7172 outOffsets = new int [2 ];
7273 }
@@ -100,19 +101,19 @@ public void compressLZ4Fast(Blackhole bh, CompressionMetrics metrics) throws IOE
100101 metrics .compressionRatio = compressedSize / (double ) inputSize ;
101102 }
102103
103- // @Benchmark
104- // public void compressLZ4High(Blackhole bh, CompressionMetrics metrics) throws IOException {
105- // int inputSize = offsets[1];
106- //
107- // var dataInput = new ByteBuffersDataInput(List.of(ByteBuffer.wrap(input)));
108- // var dataOutput = new ByteArrayDataOutput(outBuf);
109- //
110- // Compressor compressor = CompressionMode.HIGH_COMPRESSION.newCompressor();
111- // compressor.compress(dataInput, dataOutput);
112- //
113- // long compressedSize = dataOutput.getPosition();
114- // bh.consume(dataOutput);
115- //
116- // metrics.compressionRatio = compressedSize / (double) inputSize;
117- // }
104+ // @Benchmark
105+ // public void compressLZ4High(Blackhole bh, CompressionMetrics metrics) throws IOException {
106+ // int inputSize = offsets[1];
107+ //
108+ // var dataInput = new ByteBuffersDataInput(List.of(ByteBuffer.wrap(input)));
109+ // var dataOutput = new ByteArrayDataOutput(outBuf);
110+ //
111+ // Compressor compressor = CompressionMode.HIGH_COMPRESSION.newCompressor();
112+ // compressor.compress(dataInput, dataOutput);
113+ //
114+ // long compressedSize = dataOutput.getPosition();
115+ // bh.consume(dataOutput);
116+ //
117+ // metrics.compressionRatio = compressedSize / (double) inputSize;
118+ // }
118119}
0 commit comments