From 82deffcde796fe2b6260087485cbb64543aa8788 Mon Sep 17 00:00:00 2001 From: ysaed Date: Tue, 13 Jun 2017 14:35:23 -0700 Subject: [PATCH] Remove benchmarking support for fastlz. --- CMakeLists.txt | 5 ----- README.md | 6 +++--- cmake/config.h.in | 3 --- configure.ac | 3 +-- snappy-test.h | 4 ---- snappy_unittest.cc | 40 ++-------------------------------------- 6 files changed, 6 insertions(+), 55 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fff48cc..59274a1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -49,7 +49,6 @@ ENDIF (NOT HAVE_STDDEF_H) CHECK_LIBRARY_EXISTS(z zlibVersion "" HAVE_LIBZ) 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); }" HAVE_BUILTIN_EXPECT) @@ -140,10 +139,6 @@ IF (HAVE_LIBLZF) LIST(APPEND COMPRESSION_LIBS lzf) ENDIF (HAVE_LIBLZF) -IF (HAVE_LIBFASTLZ) - LIST(APPEND COMPRESSION_LIBS fastlz) -ENDIF (HAVE_LIBFASTLZ) - IF (HAVE_LIBQUICKLZ) LIST(APPEND COMPRESSION_LIBS quicklz) ENDIF (HAVE_LIBQUICKLZ) diff --git a/README.md b/README.md index e6fee99..b9db833 100644 --- a/README.md +++ b/README.md @@ -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 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 -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. Typical compression ratios (based on the benchmark suite) are about 1.5-1.7x @@ -52,7 +52,7 @@ In particular: - Snappy uses 64-bit operations in several places to process more data at once than would otherwise be possible. - Snappy assumes unaligned 32- and 64-bit loads and stores are cheap. - On some platforms, these must be emulated with single-byte loads + On some platforms, these must be emulated with single-byte loads and stores, which is much slower. - Snappy assumes little-endian throughout, and needs to byte-swap data in several places if running on a big-endian platform. @@ -126,7 +126,7 @@ before the unit tests, but you can disable them using the flag need to edit the source). 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 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 diff --git a/cmake/config.h.in b/cmake/config.h.in index 29fad3c..c06e3ad 100644 --- a/cmake/config.h.in +++ b/cmake/config.h.in @@ -22,9 +22,6 @@ /* Define to 1 if you have the header file. */ #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). */ #cmakedefine HAVE_LIBLZO2 ${HAVE_LIBLZO2} diff --git a/configure.ac b/configure.ac index 91f5447..d3441b8 100644 --- a/configure.ac +++ b/configure.ac @@ -49,7 +49,7 @@ fi # See if we have __builtin_expect. # TODO: Use AC_CACHE. AC_MSG_CHECKING([if the compiler supports __builtin_expect]) - + AC_TRY_COMPILE(, [ return __builtin_expect(1, 1) ? 1 : 0 ], [ @@ -97,7 +97,6 @@ AC_DEFUN([CHECK_EXT_COMPRESSION_LIB], [ ]) CHECK_EXT_COMPRESSION_LIB([z], [zlibVersion]) CHECK_EXT_COMPRESSION_LIB([lzo2], [lzo1x_1_15_compress]) -CHECK_EXT_COMPRESSION_LIB([fastlz], [fastlz_compress]) AC_SUBST([UNITTEST_LIBS]) # These are used by snappy-stubs-public.h.in. diff --git a/snappy-test.h b/snappy-test.h index 7b39a8c..cebb4ee 100644 --- a/snappy-test.h +++ b/snappy-test.h @@ -116,10 +116,6 @@ extern "C" { } #endif -#ifdef HAVE_LIBFASTLZ -#include "fastlz.h" -#endif - #ifdef HAVE_LIBQUICKLZ #include "quicklz.h" #endif diff --git a/snappy_unittest.cc b/snappy_unittest.cc index 798572a..19062e4 100644 --- a/snappy_unittest.cc +++ b/snappy_unittest.cc @@ -51,8 +51,6 @@ DEFINE_bool(zlib, false, "Run zlib compression (http://www.zlib.net)"); DEFINE_bool(lzo, false, "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(write_compressed, false, @@ -118,11 +116,11 @@ typedef string DataEndingAtUnreadablePage; #endif enum CompressorType { - ZLIB, LZO, FASTLZ, SNAPPY + ZLIB, LZO, SNAPPY }; const char* names[] = { - "ZLIB", "LZO", "FASTLZ", "SNAPPY" + "ZLIB", "LZO", "SNAPPY" }; 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; #endif // LZO_VERSION -#ifdef FASTLZ_VERSION - case FASTLZ: - return max(static_cast(ceil(input_size * 1.05)), 66); -#endif // FASTLZ_VERSION - case SNAPPY: return snappy::MaxCompressedLength(input_size); @@ -202,22 +195,6 @@ static bool Compress(const char* input, size_t input_size, CompressorType comp, } #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: { size_t destlen; snappy::RawCompress(input, input_size, @@ -272,18 +249,6 @@ static bool Uncompress(const string& compressed, CompressorType comp, } #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: { snappy::RawUncompress(compressed.data(), compressed.size(), string_as_array(output)); @@ -1231,7 +1196,6 @@ static void MeasureFile(const char* fname) { int repeats = (FLAGS_bytes + len) / (len + 1); if (FLAGS_zlib) Measure(input, len, ZLIB, 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); // For block-size based measurements