Switch to zlib-ng
zlib-ng boasts higher throughput than regular zlib, by combining patches from Cloudflare, zlib, and ARM's improvements to zlib along with a more modern codebase. Profiling consistently shows that compression is the largest CPU expense by far, so even a minor speed-up here is significant.
This commit is contained in:
@@ -8,7 +8,7 @@ void JNICALL
|
||||
check_zlib_free(JNIEnv *env, z_stream *stream, bool deflate)
|
||||
{
|
||||
int ret = deflate ? deflateEnd(stream) : inflateEnd(stream);
|
||||
char *msg = stream->msg;
|
||||
const char *msg = stream->msg;
|
||||
free((void*) stream);
|
||||
|
||||
switch (ret) {
|
||||
|
@@ -33,7 +33,7 @@ Java_com_velocitypowered_natives_compression_NativeZlibDeflate_init(JNIEnv *env,
|
||||
if (ret == Z_OK) {
|
||||
return (jlong) stream;
|
||||
} else {
|
||||
char *zlib_msg = stream->msg;
|
||||
const char *zlib_msg = stream->msg;
|
||||
free(stream);
|
||||
switch (ret) {
|
||||
case Z_MEM_ERROR:
|
||||
|
@@ -32,7 +32,7 @@ Java_com_velocitypowered_natives_compression_NativeZlibInflate_init(JNIEnv *env,
|
||||
if (ret == Z_OK) {
|
||||
return (jlong) stream;
|
||||
} else {
|
||||
char *zlib_msg = stream->msg;
|
||||
const char *zlib_msg = stream->msg;
|
||||
free(stream);
|
||||
switch (ret) {
|
||||
case Z_MEM_ERROR:
|
||||
|
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user