Replies: 4 comments
-
It is possible, but comes with following downsides
Is there a way to have zstd compression supported in |
Beta Was this translation helpful? Give feedback.
-
Hello I recommend the ZStd library as a compressor. In the following, I will compare the efficiency of this library with native libraries. ZstdSharp is a port of zstd compression library to С# BenchmarkDotNet=v0.13.1, OS=Windows 10.0.19044.1566 (21H2)
|
Beta Was this translation helpful? Give feedback.
-
In the next step, I developed a library that can replace the current functions by using Extension functions. I also uploaded the complete code of the library in the Repository below. https://github.com/mbtolou/ZStdHttpClient using System.Net.Http.Headers;
namespace ZstdHttpClient;
public static class HttpExtensions
{
private static readonly StringWithQualityHeaderValue ZStdHeader = new StringWithQualityHeaderValue("zstd", 1);
public static async Task<HttpResponseMessage> GetAsync(
this HttpClient client,
string url,
CompressionType cp
)
{
if (cp == CompressionType.Zstd)
client.DefaultRequestHeaders.AcceptEncoding.Add(ZStdHeader);
var response = await client.GetAsync(url);
if (cp == CompressionType.Zstd)
{
if (response.Content.Headers.ContentEncoding.LastOrDefault() == "zstd")
{
response.Content = new ZStdHttpContent(response.Content);
}
}
return response;
}
} |
Beta Was this translation helpful? Give feedback.
-
Hi. Given the compression power and reduced memory and processor usage, can you switch the library compressor to ZSTD? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
hi.
can you support zstd compression in http call ?
https://github.com/ClickHouse/ClickHouse/blob/512786346c5d615e512b8cea1c237699d1fe7153/tests/queries/0_stateless/00302_http_compression.sh
This algorithm (zstd) is 3 times faster than gzip.
https://github.com/ClickHouse/ClickHouse/blob/512786346c5d615e512b8cea1c237699d1fe7153/tests/queries/0_stateless/00302_http_compression.sh#L29
Beta Was this translation helpful? Give feedback.
All reactions