Implement optimized compression for Java 11+

Using the fact that the Java Deflater/Inflater API now supports
ByteBuffers as of Java 11, we can provide performance benefits equivalent
to the Velocity 1.0.x native compression on servers running Java 11+ on
non-macOS and non-Linux platforms (such as Windows).
This commit is contained in:
Andrew Steinborn
2019-10-04 16:57:30 -04:00
parent 078db5ca65
commit 7747679ee1
13 changed files with 215 additions and 22 deletions

View File

@@ -17,7 +17,7 @@ public class VelocityNettyThreadFactory implements ThreadFactory {
@Override
public Thread newThread(Runnable r) {
String name = String.format(nameFormat, threadNumber.incrementAndGet());
String name = String.format(nameFormat, threadNumber.getAndIncrement());
return new FastThreadLocalThread(r, name);
}
}