summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* Tag open source release 1.1.9.1.1.9Victor Costan2021-05-042-2/+2
| | | | PiperOrigin-RevId: 372007801
* 'size' remains unused if none of ZLIB, LZO and LZ4 are available.atdt2021-04-221-2/+4
| | | | | | While we're here, take care of a couple of lint warnings by converting CHECK(a != b) to CHECK_NE(a, b). PiperOrigin-RevId: 369132446
* Add project goals to CONTRIBUTING.md.Chris Mumford2021-03-121-0/+20
| | | | PiperOrigin-RevId: 362386747
* Add stubs for abseil flags.Victor Costan2021-03-087-70/+42
| | | | | | | This CL also removes support for using the gflags library to modify the flags. PiperOrigin-RevId: 361583626
* Remove unused run_microbenchmarks flag.Victor Costan2021-03-081-3/+0
| | | | PiperOrigin-RevId: 361582956
* Add absl::GetFlag and absl::SetFlag to uses of flags.Snappy Team2021-02-172-14/+18
| | | | PiperOrigin-RevId: 357807059
* Add AppVeyor status badge.Victor Costan2020-12-161-0/+1
| | | | PiperOrigin-RevId: 347861379
* Remove unused include in snappy_benchmark.cc.Victor Costan2020-12-161-2/+3
| | | | PiperOrigin-RevId: 347861229
* Split benchmarks and test tools into separate targets.Victor Costan2020-12-1610-1062/+1350
| | | | | | | | This lets us remove main() from snappy_bench.cc and snappy_unittest.cc, which simplifies integrating these tests and benchmarks with other suites. PiperOrigin-RevId: 347857427
* Merge pull request #117 from cmumford:disable-osx-fuzzerVictor Costan2020-12-161-1/+2
|\ | | | | | | PiperOrigin-RevId: 347736844
| * Disable fuzzing on OSX.Chris Mumford2020-12-151-1/+2
| | | | | | | | | | | | | | | | | | | | LibFuzzer does not ship with the Mac OSX Command Line Tools. ``` ld: file not found: /Applications/Xcode-12.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.0/lib/darwin/libclang_rt.fuzzer_osx.a clang: error: linker command failed with exit code 1 (use -v to see invocation) ```
* | Test stub improvements.Victor Costan2020-12-162-112/+102
|/ | | | PiperOrigin-RevId: 347736380
* Fixup for adding the third_party/{benchmark, googletest} submodules. (#115)Victor Costan2020-12-152-0/+0
|
* Merge pull request #114 from cmumford:werror-only-clangVictor Costan2020-12-153-370/+372
|\ | | | | | | PiperOrigin-RevId: 347660305
| * Fixed endif clause.Chris Mumford2020-12-151-1/+1
| |
| * Matching clang.Chris Mumford2020-12-151-2/+1
| |
| * Building with `-Werror` only with clang.Chris Mumford2020-12-151-4/+7
|/ | | | | | | | | | | | | | | gcc was unable to inline a function call, which caused a build failure due to `-Wall -Werror`. The build error was: ``` ../snappy.cc:292:76: error: ignoring attributes on template argument ‘__m128i’ [-Werror=ignored-attributes] 292 | static inline std::pair<__m128i /* pattern */, __m128i /* reshuffle_mask */> | ^ ../snappy.cc:292:76: error: ignoring attributes on template argument ‘__m128i’ [-Werror=ignored-attributes] cc1plus: all warnings being treated as errors ```
* Fix CHECK_EQ to call ok() instead of CheckSuccess().Chris Mumford2020-12-152-2/+2
| | | | | | CheckSuccess was removed in e1e91ee464373e0bba4aadfbd3d88a6d84dc5b95. PiperOrigin-RevId: 347625874
* Fixup for adding the third_party/{benchmark, googletest} submodules. (#111)Victor Costan2020-12-152-0/+0
|
* Rework file:: stubs.Victor Costan2020-12-152-49/+92
| | | | PiperOrigin-RevId: 347541488
* Wrap snappy_unittest in an anonymous namespace and remove static from functions.Victor Costan2020-12-153-31/+25
| | | | PiperOrigin-RevId: 347541028
* Fixup for adding the third_party/{benchmark, googletest} submodules. (#110)Victor Costan2020-12-142-0/+0
|
* Fix unused local variable warnings.Victor Costan2020-12-151-2/+14
| | | | | | This will not change the compilation output. PiperOrigin-RevId: 347525836
* Remove custom testing and benchmarking code.Victor Costan2020-12-147-433/+154
| | | | | | | | | | | | | | | | | | | | | Snappy includes a testing framework, which implements a subset of the Google Test API, and can be used when Google Test is not available. Snappy also includes a micro-benchmark framework, which implements an old version of the Google Benchmark API. This CL replaces the custom test and micro-benchmark frameworks with google/googletest and google/benchmark. The code is vendored in third_party/ via git submodules. The setup is similar to google/crc32c and google/leveldb. This CL also updates the benchmarking code to the modern Google Benchmark API. Benchmark results are expected to be more precise, as the old framework ran each benchmark with a fixed number of iterations, whereas Google Benchmark keeps iterating until the noise is low. PiperOrigin-RevId: 347456142
* Add Travis-CI build status badge to README.md.Chris Mumford2020-12-141-0/+1
| | | | PiperOrigin-RevId: 347402877
* Update Travis CI config.Victor Costan2020-12-141-5/+5
| | | | PiperOrigin-RevId: 347397797
* Replace #pragma nounroll with equivalent used elsewhere.Victor Costan2020-12-141-2/+6
| | | | PiperOrigin-RevId: 347341130
* Remove inline qualifier from static variables.Victor Costan2020-12-141-4/+4
| | | | | | This feature requires C++17. Fortunately, inline is useful for header declarations, which may be included in multiple compilation units. The declarations modified by this CL occur in a single compilation unit. PiperOrigin-RevId: 347338760
* 1) Improve the lookup table data to require less instructions to extract the ↵Snappy Team2020-12-142-126/+188
| | | | | | | | | necessary data. We now store len - offset in a signed int16, this happens to remove masking offset in the calculations and the calculations that need to be done precisely give the flags that we need for testing correctness. 2) Replace offset extraction with a lookup mask. This is less uops and is needed because we need to special case type 3 to always return 0 as to properly trigger the fallback. 3) Unroll the loop twice, this removes some loop-condition checks AND it improves the generated assembly. The loop variables tend to end up in a different register requiring mov's having two consecutive copies allows the elision of the mov's. PiperOrigin-RevId: 346663328
* Optimize zippy decompression by making IncrementalCopy faster.Shahriar Rouf2020-12-142-58/+267
| | | | | | | | | | | | | | | | | | When SSSE3 is available: - Use PSHUFB (_mm_shuffle_epi8) to handle pattern size 1 to 15 (previously it handled size 1 to 7). - This enables us to do 16 byte copies instead of 8 bytes copies because we know that the pattern size >= 16. - Use shuffle-reshuffle strategy to generate the next pattern after loading the initial pattern. This enables us to write 4 conditionals (similar to when pattern size >= 16) which would allow FDO to layout the code with respect to actual probabilities of each length. - The PSHUFB masks are now generated programmatically at compile-time. When SSSE3 is unavailable: - No change. In both cases: - assert(op < op_limit) in IncrementalCopy so that we can check 'op_limit <= buf_limit - 15' instead of 'op_limit <= buf_limit - 16'. All existing call sites of IncrementalCopy guarantee this. 'bin' case is notably >20% faster because it has many repeated character patterns (i.e. pattern_size = 1). PiperOrigin-RevId: 346454471
* Internal changeSnappy Team2020-12-031-224/+56
| | | | PiperOrigin-RevId: 345360683
* Optimize zippy decompression by making IncrementalCopy faster.Shahriar Rouf2020-12-031-56/+224
| | | | | | | | | | | | | | | | | | When SSSE3 is available: - Use PSHUFB (_mm_shuffle_epi8) to handle pattern size 1 to 15 (previously it handled size 1 to 7). - This enables us to do 16 byte copies instead of 8 bytes copies because we know that the pattern size >= 16. - Use shuffle-reshuffle strategy to generate the next pattern after loading the initial pattern. This enables us to write 4 conditionals (similar to when pattern size >= 16) which would allow FDO to layout the code with respect to actual probabilities of each length. - The PSHUFB masks are now generated programmatically at compile-time. When SSSE3 is unavailable: - No change. In both cases: - assert(op < op_limit) in IncrementalCopy so that we can check 'op_limit <= buf_limit - 15' instead of 'op_limit <= buf_limit - 16'. All existing call sites of IncrementalCopy guarantee this. 'bin' case is notably >20% faster because it has many repeated character patterns (i.e. pattern_size = 1). PiperOrigin-RevId: 345340892
* Fix opensource versionSnappy Team2020-11-194-44/+49
| | | | PiperOrigin-RevId: 343272548
* Add LZ4 as a benchmark option. Snappy is starting to look really good ↵Snappy Team2020-11-183-9/+45
| | | | | | compared to LZ4. LZ4 is considered the fastest solution by many on internet. We now see that Snappy is actually becoming very competitive with compression a little faster and decompression slower but certainly not terribly slower. PiperOrigin-RevId: 343140860
* Extend validate benchmarks over all types and also add a medley for validation.Snappy Team2020-11-181-15/+36
| | | | | | | | I also made the compression happen only once per benchmark. This way we get a cleaner measurement of #branch-misses using "perf stat". Compression suffers naturally from a large number of branch misses which was polluting the measurements. This showed that with the new decompression the branch misses is actually much lower then initially reported, only .2% and very stable, ie. doesn't really fluctuate with how you execute the benchmarks. PiperOrigin-RevId: 342628576
* Bug fix. Error on 0 offset copies.Snappy Team2020-11-181-0/+2
| | | | PiperOrigin-RevId: 342447553
* Make zippy decompression branchlessSnappy Team2020-11-182-6/+210
| | | | PiperOrigin-RevId: 342423961
* Revert zippy optimization that causes heap buffer overflows.Snappy Team2020-11-181-140/+54
| | | | PiperOrigin-RevId: 342283314
* Optimize zippy unzipping by upto >10% by making IncrementalCopy faster.Shahriar Rouf2020-11-181-54/+140
| | | | | | | | | | | | | | | | When SSSE3 is available: - Use PSHUFB (_mm_shuffle_epi8) to handle pattern size 1 to 15 (previously it handled size 1 to 7). - This enables us to do 16 byte copies instead of 8 bytes copies because we know that the pattern size >= 16. - Use shuffle-reshuffle strategy to generate the next pattern after loading the initial pattern. This enables us to write 4 conditionals (similar to when pattern size >= 16) which would allow FDO to layout the code with respect to actual probabilities of each length. - The PSHUFB masks are now generated programmatically at compile-time. When SSSE3 is unavailable: - No change. In both cases: - assert(op < op_limit) in IncrementalCopy so that we can check 'op_limit <= buf_limit - 15' instead of 'op_limit <= buf_limit - 16'. All existing call sites of IncrementalCopy guarantee this. PiperOrigin-RevId: 342267037
* Add a benchmark that decreased the branch prediction memorization by ↵Snappy Team2020-11-181-0/+27
| | | | | | increasing the amount of independent branches executed per benchmark iteration. PiperOrigin-RevId: 342242843
* Change hash function for Compress.Luca Versari2020-11-181-12/+10
| | | | | | | | | | | ((a*b)>>18) & mask has higher throughput than (a*b)>>shift, and produces the same results when the hash table size is 2**14. In other cases, the hash function is still good, but it's not as necessary for that to be the case as the input is small anyway. This speeds up in encoding, especially in cases where hashing is a significant part of the encoding critical path (small or uncompressible files). PiperOrigin-RevId: 341498741
* Merge pull request #107 from jsteemann:bug-fix/fix-compile-warningVictor Costan2020-11-031-11/+11
|\ | | | | | | PiperOrigin-RevId: 340505526
| * fix compile warnings due to missing override specifiersjsteemann2020-10-291-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When building Snappy with compiler option `-Wsuggest-override` set via the CMAKE_CXX_FLAGS, compilation produces warnings in `snappy-sinksource.h`: ``` In file included from ./snappy-fork/snappy-sinksource.cc:32: ./snappy-fork/snappy-sinksource.h:150:18: error: ‘virtual size_t snappy::ByteArraySource::Available() const’ can be marked override [-Werror=suggest-override] 150 | virtual size_t Available() const; | ^~~~~~~~~ ./snappy-fork/snappy-sinksource.h:151:23: error: ‘virtual const char* snappy::ByteArraySource::Peek(size_t*)’ can be marked override [-Werror=suggest-override] 151 | virtual const char* Peek(size_t* len); | ^~~~ ./snappy-fork/snappy-sinksource.h:152:16: error: ‘virtual void snappy::ByteArraySource::Skip(size_t)’ can be marked override [-Werror=suggest-override] 152 | virtual void Skip(size_t n); | ^~~~ ./snappy-fork/snappy-sinksource.h:163:16: error: ‘virtual void snappy::UncheckedByteArraySink::Append(const char*, size_t)’ can be marked override [-Werror=suggest-override] 163 | virtual void Append(const char* data, size_t n); | ^~~~~~ ./snappy-fork/snappy-sinksource.h:164:17: error: ‘virtual char* snappy::UncheckedByteArraySink::GetAppendBuffer(size_t, char*)’ can be marked override [-Werror=suggest-override] 164 | virtual char* GetAppendBuffer(size_t len, char* scratch); | ^~~~~~~~~~~~~~~ ./snappy-fork/snappy-sinksource.h:165:17: error: ‘virtual char* snappy::UncheckedByteArraySink::GetAppendBufferVariable(size_t, size_t, char*, size_t, size_t*)’ can be marked override [-Werror=suggest-override] 165 | virtual char* GetAppendBufferVariable( | ^~~~~~~~~~~~~~~~~~~~~~~ ./snappy-fork/snappy-sinksource.h:168:16: error: ‘virtual void snappy::UncheckedByteArraySink::AppendAndTakeOwnership(char*, size_t, void (*)(void*, const char*, size_t), void*)’ can be marked override [-Werror=suggest-override] 168 | virtual void AppendAndTakeOwnership( | ^~~~~~~~~~~~~~~~~~~~~~ cc1plus: all warnings being treated as errors ``` This PR adds the missing override specifiers to the sink implementations, so compilation works fine again. Tested it with g++-9.3 and g++-10.2. Compatibility note: Override specifiers were introduced with C++11, which Snappy seems to effectively require, at least according to its CMakeLists.txt file and due to the usage of some C++11-only STL types in its tests.
* | Fix the use of op + len when op is nullptr and len is non-zero.Snappy Team2020-11-031-3/+2
| | | | | | | | | | | | | | See https://reviews.llvm.org/D67122 for some discussion of why this can matter. I don't think this should have any noticeable effect on performance. PiperOrigin-RevId: 340255083
* | Run clang-formatLuca Versari2020-11-031-89/+58
|/ | | | PiperOrigin-RevId: 339897712
* Replace ARCH_K8 with __x86_64__.Chris Kennelly2020-10-072-4/+2
| | | | PiperOrigin-RevId: 321389098
* Replace the division with a constant table in IncrementalCopySnappy Team2020-07-111-1/+4
| | | | PiperOrigin-RevId: 320686580
* Correct uninitialized variable.Snappy Team2020-06-011-1/+2
| | | | PiperOrigin-RevId: 312741918
* Revise stubs for ARCH_{K8,PPC,ARM}.Victor Costan2020-05-061-10/+4
| | | | | | | | | | | | | * ARCH_K8 and ARCH_ARM now work correctly on MSVC. * ARCH_PPC now uses the same macro as tcmalloc. Microsoft documentation: https://docs.microsoft.com/en-us/cpp/preprocessor/predefined-macros?view=vs-2019 PowerPC documentation: http://openpowerfoundation.org/wp-content/uploads/resources/leabi/content/dbdoclet.50655243_75216.html PiperOrigin-RevId: 310160787
* Remove ARCH_* guards around Bits::FindLSBSetNonZero64().Victor Costan2020-05-051-24/+29
| | | | | | | | | | | | | | | | | | | | | Bits::FindLSBSetNonZero64() is now available unconditionally, and it should be easier to reason about the code included in each build configuration. This reduces the amount of conditional compiling going on, which makes it easier to reason about what stubs are a used in each build configuration. The guards were added to work around the fact that MSVC has a _BitScanForward64() intrinsic, but the intrinsic is only implemented on 64-bit targets, and causes a compilation error on 32-bit targets errors. By contrast, Clang and GCC support __builtin_ctzll() everywhere, and implement it with varying efficiency. This CL reworks the conditional compilation directives so that Bits::FindLSBSetNonZero64() uses the _BitScanForward64() intrinsic on MSVC when available, and the portable implementation otherwise. PiperOrigin-RevId: 310007748