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:
Andrew Steinborn
2019-09-08 23:30:28 -04:00
parent 63dcc56735
commit e21c33d435
8 changed files with 34 additions and 8 deletions

View File

@@ -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) {

View File

@@ -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:

View File

@@ -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: