Skip to content

Instantly share code, notes, and snippets.

@nigeltao
nigeltao / snappy_unittest.diff
Created August 31, 2017 05:05
snappy_unittest.diff
diff --git a/snappy_unittest.cc b/snappy_unittest.cc
index fcb3261..dc473a3 100644
--- a/snappy_unittest.cc
+++ b/snappy_unittest.cc
@@ -47,11 +47,11 @@ DEFINE_int32(end_len, -1,
DEFINE_int32(bytes, 10485760,
"How many bytes to compress/uncompress per file for timing");
-DEFINE_bool(zlib, false,
+DEFINE_bool(zlib, true,
@nigeltao
nigeltao / inffast64.benchmarks.txt
Created August 25, 2017 02:47
inffast64.c benchmarks
Speed up inflate_fast by up to 1.5x on x86_64.
https://github.com/google/snappy is an unrelated compression format but
its snappy_unittest program is able to benchmark the snappy library and
the zlib library. We can re-purpose it, via LD_LIBRARY_PATH, to measure
different versions of zlib, such as before / after this commit.
snappy_unittest's output looks like:
testdata/alice29.txt :
@nigeltao
nigeltao / inffast64.diff
Created August 25, 2017 02:13
zlib: diff -u inffast.c contrib/inffast64/inffast64.c
--- inffast.c 2017-08-25 12:05:02.309161736 +1000
+++ contrib/inffast64/inffast64.c 2017-08-25 12:09:05.504252162 +1000
@@ -11,8 +11,11 @@
#ifdef ASMINF
# pragma message("Assembler code may have bugs -- use at your own risk")
#elif INFLATE_FAST64
-/* Skip this implementation; use contrib/inffast64/inffast64.c instead. */
-#else
+
+#if defined(ZLIB_INTERNAL_HAVE_64_BIT_UNALIGNED_LOADS) || \