Skip to content
A port of Snappy, LZO, LZ4, and Zstandard to Java
Branch: master
Clone or download
martint Optimize match length count function
Using a counted loop improves performance, especially for long matches

Benchmark (matchLength)  (padding)  Mode  Cnt   Score   Error  Units
before                1          0  avgt   30   4.452 ± 0.074  ns/op
after                 1          0  avgt   30   4.450 ± 0.292  ns/op

before                1          1  avgt   30   4.438 ± 0.069  ns/op
after                 1          1  avgt   30   4.178 ± 0.097  ns/op

before                1          3  avgt   30   4.600 ± 0.111  ns/op
after                 1          3  avgt   30   4.231 ± 0.162  ns/op

before                1          7  avgt   30   4.276 ± 0.089  ns/op
after                 1          7  avgt   30   3.863 ± 0.065  ns/op

before                1         50  avgt   30   4.302 ± 0.093  ns/op
after                 1         50  avgt   30   3.867 ± 0.059  ns/op

before                3          0  avgt   30   4.745 ± 0.025  ns/op
after                 3          0  avgt   30   4.198 ± 0.103  ns/op

before                3          1  avgt   30   4.784 ± 0.058  ns/op
after                 3          1  avgt   30   4.176 ± 0.070  ns/op

before                3          3  avgt   30   4.807 ± 0.133  ns/op
after                 3          3  avgt   30   4.165 ± 0.091  ns/op

before                3          7  avgt   30   4.311 ± 0.132  ns/op
after                 3          7  avgt   30   3.821 ± 0.029  ns/op

before                3         50  avgt   30   4.289 ± 0.099  ns/op
after                 3         50  avgt   30   3.831 ± 0.085  ns/op

before                7          0  avgt   30   4.232 ± 0.038  ns/op
after                 7          0  avgt   30   3.908 ± 0.121  ns/op

before                7          1  avgt   30   4.210 ± 0.043  ns/op
after                 7          1  avgt   30   3.924 ± 0.085  ns/op

before                7          3  avgt   30   4.179 ± 0.123  ns/op
after                 7          3  avgt   30   3.845 ± 0.085  ns/op

before                7          7  avgt   30   4.226 ± 0.114  ns/op
after                 7          7  avgt   30   3.803 ± 0.031  ns/op

before                7         50  avgt   30   4.271 ± 0.129  ns/op
after                 7         50  avgt   30   3.842 ± 0.085  ns/op

before               15          0  avgt   30   4.848 ± 0.095  ns/op
after                15          0  avgt   30   4.397 ± 0.111  ns/op

before               15          1  avgt   30   4.813 ± 0.045  ns/op
after                15          1  avgt   30   4.384 ± 0.087  ns/op

before               15          3  avgt   30   4.835 ± 0.096  ns/op
after                15          3  avgt   30   4.422 ± 0.116  ns/op

before               15          7  avgt   30   4.863 ± 0.075  ns/op
after                15          7  avgt   30   4.413 ± 0.046  ns/op

before               15         50  avgt   30   4.917 ± 0.143  ns/op
after                15         50  avgt   30   4.364 ± 0.044  ns/op

before              127          0  avgt   30  14.394 ± 0.320  ns/op
after               127          0  avgt   30  11.832 ± 0.396  ns/op

before              127          1  avgt   30  14.352 ± 0.273  ns/op
after               127          1  avgt   30  11.543 ± 0.275  ns/op

before              127          3  avgt   30  14.290 ± 0.142  ns/op
after               127          3  avgt   30  11.709 ± 0.293  ns/op

before              127          7  avgt   30  15.361 ± 2.277  ns/op
after               127          7  avgt   30  11.657 ± 0.296  ns/op

before              127         50  avgt   30  14.121 ± 0.301  ns/op
after               127         50  avgt   30  10.911 ± 0.450  ns/op

before              511          0  avgt   30  47.233 ± 0.905  ns/op
after               511          0  avgt   30  31.330 ± 2.087  ns/op

before              511          1  avgt   30  47.137 ± 0.529  ns/op
after               511          1  avgt   30  30.074 ± 1.008  ns/op

before              511          3  avgt   30  47.017 ± 0.474  ns/op
after               511          3  avgt   30  30.523 ± 1.856  ns/op

before              511          7  avgt   30  46.510 ± 0.441  ns/op
after               511          7  avgt   30  31.102 ± 4.902  ns/op

before              511         50  avgt   30  46.789 ± 1.311  ns/op
after               511         50  avgt   30  27.405 ± 0.225  ns/op
Latest commit 77667d1 Nov 2, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
testdata Add multiple test corpuses for unit testing and benchmarks Jul 17, 2015
.gitignore
.travis.yml
README.md
license.txt
notice.md
pom.xml

README.md

Compression in pure Java

Maven Central Build Status

This library contains implementations of LZ4, Snappy, and LZO written in pure Java. They are typically 10-40% faster than the JNI wrapper for the native libraries.

Hadoop CompressionCodec

In addition to the raw block encoders, there are implementations of the Hadoop CompressionCodec for each algorithm. They are typically 300% faster than the JNI wrappers.

Requirements

This library requires a Java 1.8+ virtual machine containing the sun.misc.Unsafe interface running on a little endian platform.

You can’t perform that action at this time.