Remove benchmarking support for fastlz.

This commit is contained in:
ysaed 2017-06-13 14:35:23 -07:00 committed by Victor Costan
parent 18488d6212
commit 82deffcde7
6 changed files with 6 additions and 55 deletions

View File

@ -49,7 +49,6 @@ ENDIF (NOT HAVE_STDDEF_H)
CHECK_LIBRARY_EXISTS(z zlibVersion "" HAVE_LIBZ) CHECK_LIBRARY_EXISTS(z zlibVersion "" HAVE_LIBZ)
CHECK_LIBRARY_EXISTS(lzo2 lzo1x_1_15_compress "" HAVE_LIBLZO2) CHECK_LIBRARY_EXISTS(lzo2 lzo1x_1_15_compress "" HAVE_LIBLZO2)
CHECK_LIBRARY_EXISTS(fastlz fastlz_compress "" HAVE_LIBFASTLZ)
CHECK_CXX_SOURCE_COMPILES("int main(void) { return __builtin_expect(0, 1); }" CHECK_CXX_SOURCE_COMPILES("int main(void) { return __builtin_expect(0, 1); }"
HAVE_BUILTIN_EXPECT) HAVE_BUILTIN_EXPECT)
@ -140,10 +139,6 @@ IF (HAVE_LIBLZF)
LIST(APPEND COMPRESSION_LIBS lzf) LIST(APPEND COMPRESSION_LIBS lzf)
ENDIF (HAVE_LIBLZF) ENDIF (HAVE_LIBLZF)
IF (HAVE_LIBFASTLZ)
LIST(APPEND COMPRESSION_LIBS fastlz)
ENDIF (HAVE_LIBFASTLZ)
IF (HAVE_LIBQUICKLZ) IF (HAVE_LIBQUICKLZ)
LIST(APPEND COMPRESSION_LIBS quicklz) LIST(APPEND COMPRESSION_LIBS quicklz)
ENDIF (HAVE_LIBQUICKLZ) ENDIF (HAVE_LIBQUICKLZ)

View File

@ -34,7 +34,7 @@ Snappy is intended to be fast. On a single core of a Core i7 processor
in 64-bit mode, it compresses at about 250 MB/sec or more and decompresses at in 64-bit mode, it compresses at about 250 MB/sec or more and decompresses at
about 500 MB/sec or more. (These numbers are for the slowest inputs in our about 500 MB/sec or more. (These numbers are for the slowest inputs in our
benchmark suite; others are much faster.) In our tests, Snappy usually benchmark suite; others are much faster.) In our tests, Snappy usually
is faster than algorithms in the same class (e.g. LZO, LZF, FastLZ, QuickLZ, is faster than algorithms in the same class (e.g. LZO, LZF, QuickLZ,
etc.) while achieving comparable compression ratios. etc.) while achieving comparable compression ratios.
Typical compression ratios (based on the benchmark suite) are about 1.5-1.7x Typical compression ratios (based on the benchmark suite) are about 1.5-1.7x
@ -126,7 +126,7 @@ before the unit tests, but you can disable them using the flag
need to edit the source). need to edit the source).
Finally, snappy can benchmark Snappy against a few other compression libraries Finally, snappy can benchmark Snappy against a few other compression libraries
(zlib, LZO, LZF, FastLZ and QuickLZ), if they were detected at configure time. (zlib, LZO, LZF, and QuickLZ), if they were detected at configure time.
To benchmark using a given file, give the compression algorithm you want to test To benchmark using a given file, give the compression algorithm you want to test
Snappy against (e.g. --zlib) and then a list of one or more file names on the Snappy against (e.g. --zlib) and then a list of one or more file names on the
command line. The testdata/ directory contains the files used by the command line. The testdata/ directory contains the files used by the

View File

@ -22,9 +22,6 @@
/* Define to 1 if you have the <inttypes.h> header file. */ /* Define to 1 if you have the <inttypes.h> header file. */
#cmakedefine HAVE_INTTYPES_H ${HAVE_INTTYPES_H} #cmakedefine HAVE_INTTYPES_H ${HAVE_INTTYPES_H}
/* Define to 1 if you have the `fastlz' library (-lfastlz). */
#cmakedefine HAVE_LIBFASTLZ ${HAVE_LIBFASTLZ}
/* Define to 1 if you have the `lzo2' library (-llzo2). */ /* Define to 1 if you have the `lzo2' library (-llzo2). */
#cmakedefine HAVE_LIBLZO2 ${HAVE_LIBLZO2} #cmakedefine HAVE_LIBLZO2 ${HAVE_LIBLZO2}

View File

@ -97,7 +97,6 @@ AC_DEFUN([CHECK_EXT_COMPRESSION_LIB], [
]) ])
CHECK_EXT_COMPRESSION_LIB([z], [zlibVersion]) CHECK_EXT_COMPRESSION_LIB([z], [zlibVersion])
CHECK_EXT_COMPRESSION_LIB([lzo2], [lzo1x_1_15_compress]) CHECK_EXT_COMPRESSION_LIB([lzo2], [lzo1x_1_15_compress])
CHECK_EXT_COMPRESSION_LIB([fastlz], [fastlz_compress])
AC_SUBST([UNITTEST_LIBS]) AC_SUBST([UNITTEST_LIBS])
# These are used by snappy-stubs-public.h.in. # These are used by snappy-stubs-public.h.in.

View File

@ -116,10 +116,6 @@ extern "C" {
} }
#endif #endif
#ifdef HAVE_LIBFASTLZ
#include "fastlz.h"
#endif
#ifdef HAVE_LIBQUICKLZ #ifdef HAVE_LIBQUICKLZ
#include "quicklz.h" #include "quicklz.h"
#endif #endif

View File

@ -51,8 +51,6 @@ DEFINE_bool(zlib, false,
"Run zlib compression (http://www.zlib.net)"); "Run zlib compression (http://www.zlib.net)");
DEFINE_bool(lzo, false, DEFINE_bool(lzo, false,
"Run LZO compression (http://www.oberhumer.com/opensource/lzo/)"); "Run LZO compression (http://www.oberhumer.com/opensource/lzo/)");
DEFINE_bool(fastlz, false,
"Run FastLZ compression (http://www.fastlz.org/");
DEFINE_bool(snappy, true, "Run snappy compression"); DEFINE_bool(snappy, true, "Run snappy compression");
DEFINE_bool(write_compressed, false, DEFINE_bool(write_compressed, false,
@ -118,11 +116,11 @@ typedef string DataEndingAtUnreadablePage;
#endif #endif
enum CompressorType { enum CompressorType {
ZLIB, LZO, FASTLZ, SNAPPY ZLIB, LZO, SNAPPY
}; };
const char* names[] = { const char* names[] = {
"ZLIB", "LZO", "FASTLZ", "SNAPPY" "ZLIB", "LZO", "SNAPPY"
}; };
static size_t MinimumRequiredOutputSpace(size_t input_size, static size_t MinimumRequiredOutputSpace(size_t input_size,
@ -138,11 +136,6 @@ static size_t MinimumRequiredOutputSpace(size_t input_size,
return input_size + input_size/64 + 16 + 3; return input_size + input_size/64 + 16 + 3;
#endif // LZO_VERSION #endif // LZO_VERSION
#ifdef FASTLZ_VERSION
case FASTLZ:
return max(static_cast<int>(ceil(input_size * 1.05)), 66);
#endif // FASTLZ_VERSION
case SNAPPY: case SNAPPY:
return snappy::MaxCompressedLength(input_size); return snappy::MaxCompressedLength(input_size);
@ -202,22 +195,6 @@ static bool Compress(const char* input, size_t input_size, CompressorType comp,
} }
#endif // LZO_VERSION #endif // LZO_VERSION
#ifdef FASTLZ_VERSION
case FASTLZ: {
// Use level 1 compression since we mostly care about speed.
int destlen = fastlz_compress_level(
1,
input,
input_size,
string_as_array(compressed));
if (!compressed_is_preallocated) {
compressed->resize(destlen);
}
CHECK_NE(destlen, 0);
break;
}
#endif // FASTLZ_VERSION
case SNAPPY: { case SNAPPY: {
size_t destlen; size_t destlen;
snappy::RawCompress(input, input_size, snappy::RawCompress(input, input_size,
@ -272,18 +249,6 @@ static bool Uncompress(const string& compressed, CompressorType comp,
} }
#endif // LZO_VERSION #endif // LZO_VERSION
#ifdef FASTLZ_VERSION
case FASTLZ: {
output->resize(size);
int destlen = fastlz_decompress(compressed.data(),
compressed.length(),
string_as_array(output),
size);
CHECK_EQ(destlen, size);
break;
}
#endif // FASTLZ_VERSION
case SNAPPY: { case SNAPPY: {
snappy::RawUncompress(compressed.data(), compressed.size(), snappy::RawUncompress(compressed.data(), compressed.size(),
string_as_array(output)); string_as_array(output));
@ -1231,7 +1196,6 @@ static void MeasureFile(const char* fname) {
int repeats = (FLAGS_bytes + len) / (len + 1); int repeats = (FLAGS_bytes + len) / (len + 1);
if (FLAGS_zlib) Measure(input, len, ZLIB, repeats, 1024<<10); if (FLAGS_zlib) Measure(input, len, ZLIB, repeats, 1024<<10);
if (FLAGS_lzo) Measure(input, len, LZO, repeats, 1024<<10); if (FLAGS_lzo) Measure(input, len, LZO, repeats, 1024<<10);
if (FLAGS_fastlz) Measure(input, len, FASTLZ, repeats, 1024<<10);
if (FLAGS_snappy) Measure(input, len, SNAPPY, repeats, 4096<<10); if (FLAGS_snappy) Measure(input, len, SNAPPY, repeats, 4096<<10);
// For block-size based measurements // For block-size based measurements