snappy-ruby 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/LICENSE +21 -0
- data/README.md +77 -0
- data/Rakefile +12 -0
- data/ext/snappy/extconf.rb +83 -0
- data/ext/snappy/snappy-src/AUTHORS +1 -0
- data/ext/snappy/snappy-src/BUILD.bazel +211 -0
- data/ext/snappy/snappy-src/CMakeLists.txt +467 -0
- data/ext/snappy/snappy-src/CONTRIBUTING.md +31 -0
- data/ext/snappy/snappy-src/COPYING +54 -0
- data/ext/snappy/snappy-src/MODULE.bazel +23 -0
- data/ext/snappy/snappy-src/NEWS +215 -0
- data/ext/snappy/snappy-src/README.md +165 -0
- data/ext/snappy/snappy-src/WORKSPACE +27 -0
- data/ext/snappy/snappy-src/WORKSPACE.bzlmod +0 -0
- data/ext/snappy/snappy-src/cmake/SnappyConfig.cmake.in +33 -0
- data/ext/snappy/snappy-src/cmake/config.h.in +75 -0
- data/ext/snappy/snappy-src/config.h +78 -0
- data/ext/snappy/snappy-src/docs/README.md +72 -0
- data/ext/snappy/snappy-src/format_description.txt +110 -0
- data/ext/snappy/snappy-src/framing_format.txt +135 -0
- data/ext/snappy/snappy-src/snappy-c.cc +90 -0
- data/ext/snappy/snappy-src/snappy-c.h +138 -0
- data/ext/snappy/snappy-src/snappy-internal.h +444 -0
- data/ext/snappy/snappy-src/snappy-sinksource.cc +121 -0
- data/ext/snappy/snappy-src/snappy-sinksource.h +182 -0
- data/ext/snappy/snappy-src/snappy-stubs-internal.cc +42 -0
- data/ext/snappy/snappy-src/snappy-stubs-internal.h +531 -0
- data/ext/snappy/snappy-src/snappy-stubs-public.h +60 -0
- data/ext/snappy/snappy-src/snappy-stubs-public.h.in +63 -0
- data/ext/snappy/snappy-src/snappy-test.cc +503 -0
- data/ext/snappy/snappy-src/snappy-test.h +342 -0
- data/ext/snappy/snappy-src/snappy.cc +2666 -0
- data/ext/snappy/snappy-src/snappy.h +257 -0
- data/ext/snappy/snappy-src/snappy_test_data.cc +57 -0
- data/ext/snappy/snappy-src/snappy_test_data.h +68 -0
- data/ext/snappy/snappy-src/snappy_test_tool.cc +471 -0
- data/ext/snappy/snappy-src/snappy_unittest.cc +1023 -0
- data/ext/snappy/snappy.c +282 -0
- data/lib/snappy/snappy.so +0 -0
- data/lib/snappy.rb +5 -0
- metadata +142 -0
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
Snappy v1.2.2, Mar 26th 2025:
|
|
2
|
+
|
|
3
|
+
* We added a new compression level in v1.2.1 which compresses a bit
|
|
4
|
+
denser but slower. Decompression speed should be even faster with it.
|
|
5
|
+
|
|
6
|
+
* We fixed a very old issue of data corruption when compressed size
|
|
7
|
+
exceeds 4GB. This can happen when you compress data close to 4GB
|
|
8
|
+
and it's incompressible, for example, random data.
|
|
9
|
+
|
|
10
|
+
* Started to use minimum CMake 3.10 because older ones are not
|
|
11
|
+
planned to be supported.
|
|
12
|
+
|
|
13
|
+
* Various other small fixes and performance improvements (especially
|
|
14
|
+
for clang).
|
|
15
|
+
|
|
16
|
+
Snappy v1.1.10, Mar 8th 2023:
|
|
17
|
+
|
|
18
|
+
* Performance improvements
|
|
19
|
+
|
|
20
|
+
* Compilation fixes for various environments
|
|
21
|
+
|
|
22
|
+
Snappy v1.1.9, May 4th 2021:
|
|
23
|
+
|
|
24
|
+
* Performance improvements.
|
|
25
|
+
|
|
26
|
+
* Google Test and Google Benchmark are now bundled in third_party/.
|
|
27
|
+
|
|
28
|
+
Snappy v1.1.8, January 15th 2020:
|
|
29
|
+
|
|
30
|
+
* Small performance improvements.
|
|
31
|
+
|
|
32
|
+
* Removed snappy::string alias for std::string.
|
|
33
|
+
|
|
34
|
+
* Improved CMake configuration.
|
|
35
|
+
|
|
36
|
+
Snappy v1.1.7, August 24th 2017:
|
|
37
|
+
|
|
38
|
+
* Improved CMake build support for 64-bit Linux distributions.
|
|
39
|
+
|
|
40
|
+
* MSVC builds now use MSVC-specific intrinsics that map to clzll.
|
|
41
|
+
|
|
42
|
+
* ARM64 (AArch64) builds use the code paths optimized for 64-bit processors.
|
|
43
|
+
|
|
44
|
+
Snappy v1.1.6, July 12th 2017:
|
|
45
|
+
|
|
46
|
+
This is a re-release of v1.1.5 with proper SONAME / SOVERSION values.
|
|
47
|
+
|
|
48
|
+
Snappy v1.1.5, June 28th 2017:
|
|
49
|
+
|
|
50
|
+
This release has broken SONAME / SOVERSION values. Users of snappy as a shared
|
|
51
|
+
library should avoid 1.1.5 and use 1.1.6 instead. SONAME / SOVERSION errors will
|
|
52
|
+
manifest as the dynamic library loader complaining that it cannot find snappy's
|
|
53
|
+
shared library file (libsnappy.so / libsnappy.dylib), or that the library it
|
|
54
|
+
found does not have the required version. 1.1.6 has the same code as 1.1.5, but
|
|
55
|
+
carries build configuration fixes for the issues above.
|
|
56
|
+
|
|
57
|
+
* Add CMake build support. The autoconf build support is now deprecated, and
|
|
58
|
+
will be removed in the next release.
|
|
59
|
+
|
|
60
|
+
* Add AppVeyor configuration, for Windows CI coverage.
|
|
61
|
+
|
|
62
|
+
* Small performance improvement on little-endian PowerPC.
|
|
63
|
+
|
|
64
|
+
* Small performance improvement on LLVM with position-independent executables.
|
|
65
|
+
|
|
66
|
+
* Fix a few issues with various build environments.
|
|
67
|
+
|
|
68
|
+
Snappy v1.1.4, January 25th 2017:
|
|
69
|
+
|
|
70
|
+
* Fix a 1% performance regression when snappy is used in PIE executables.
|
|
71
|
+
|
|
72
|
+
* Improve compression performance by 5%.
|
|
73
|
+
|
|
74
|
+
* Improve decompression performance by 20%.
|
|
75
|
+
|
|
76
|
+
Snappy v1.1.3, July 6th 2015:
|
|
77
|
+
|
|
78
|
+
This is the first release to be done from GitHub, which means that
|
|
79
|
+
some minor things like the ChangeLog format has changed (git log
|
|
80
|
+
format instead of svn log).
|
|
81
|
+
|
|
82
|
+
* Add support for Uncompress() from a Source to a Sink.
|
|
83
|
+
|
|
84
|
+
* Various minor changes to improve MSVC support; in particular,
|
|
85
|
+
the unit tests now compile and run under MSVC.
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
Snappy v1.1.2, February 28th 2014:
|
|
89
|
+
|
|
90
|
+
This is a maintenance release with no changes to the actual library
|
|
91
|
+
source code.
|
|
92
|
+
|
|
93
|
+
* Stop distributing benchmark data files that have unclear
|
|
94
|
+
or unsuitable licensing.
|
|
95
|
+
|
|
96
|
+
* Add support for padding chunks in the framing format.
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
Snappy v1.1.1, October 15th 2013:
|
|
100
|
+
|
|
101
|
+
* Add support for uncompressing to iovecs (scatter I/O).
|
|
102
|
+
The bulk of this patch was contributed by Mohit Aron.
|
|
103
|
+
|
|
104
|
+
* Speed up decompression by ~2%; much more so (~13-20%) on
|
|
105
|
+
a few benchmarks on given compilers and CPUs.
|
|
106
|
+
|
|
107
|
+
* Fix a few issues with MSVC compilation.
|
|
108
|
+
|
|
109
|
+
* Support truncated test data in the benchmark.
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
Snappy v1.1.0, January 18th 2013:
|
|
113
|
+
|
|
114
|
+
* Snappy now uses 64 kB block size instead of 32 kB. On average,
|
|
115
|
+
this means it compresses about 3% denser (more so for some
|
|
116
|
+
inputs), at the same or better speeds.
|
|
117
|
+
|
|
118
|
+
* libsnappy no longer depends on iostream.
|
|
119
|
+
|
|
120
|
+
* Some small performance improvements in compression on x86
|
|
121
|
+
(0.5–1%).
|
|
122
|
+
|
|
123
|
+
* Various portability fixes for ARM-based platforms, for MSVC,
|
|
124
|
+
and for GNU/Hurd.
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
Snappy v1.0.5, February 24th 2012:
|
|
128
|
+
|
|
129
|
+
* More speed improvements. Exactly how big will depend on
|
|
130
|
+
the architecture:
|
|
131
|
+
|
|
132
|
+
- 3–10% faster decompression for the base case (x86-64).
|
|
133
|
+
|
|
134
|
+
- ARMv7 and higher can now use unaligned accesses,
|
|
135
|
+
and will see about 30% faster decompression and
|
|
136
|
+
20–40% faster compression.
|
|
137
|
+
|
|
138
|
+
- 32-bit platforms (ARM and 32-bit x86) will see 2–5%
|
|
139
|
+
faster compression.
|
|
140
|
+
|
|
141
|
+
These are all cumulative (e.g., ARM gets all three speedups).
|
|
142
|
+
|
|
143
|
+
* Fixed an issue where the unit test would crash on system
|
|
144
|
+
with less than 256 MB address space available,
|
|
145
|
+
e.g. some embedded platforms.
|
|
146
|
+
|
|
147
|
+
* Added a framing format description, for use over e.g. HTTP,
|
|
148
|
+
or for a command-line compressor. We do not have any
|
|
149
|
+
implementations of this at the current point, but there seems
|
|
150
|
+
to be enough of a general interest in the topic.
|
|
151
|
+
Also make the format description slightly clearer.
|
|
152
|
+
|
|
153
|
+
* Remove some compile-time warnings in -Wall
|
|
154
|
+
(mostly signed/unsigned comparisons), for easier embedding
|
|
155
|
+
into projects that use -Wall -Werror.
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
Snappy v1.0.4, September 15th 2011:
|
|
159
|
+
|
|
160
|
+
* Speeded up the decompressor somewhat; typically about 2–8%
|
|
161
|
+
for Core i7, in 64-bit mode (comparable for Opteron).
|
|
162
|
+
Somewhat more for some tests, almost no gain for others.
|
|
163
|
+
|
|
164
|
+
* Make Snappy compile on certain platforms it didn't before
|
|
165
|
+
(Solaris with SunPro C++, HP-UX, AIX).
|
|
166
|
+
|
|
167
|
+
* Correct some minor errors in the format description.
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
Snappy v1.0.3, June 2nd 2011:
|
|
171
|
+
|
|
172
|
+
* Speeded up the decompressor somewhat; about 3-6% for Core 2,
|
|
173
|
+
6-13% for Core i7, and 5-12% for Opteron (all in 64-bit mode).
|
|
174
|
+
|
|
175
|
+
* Added compressed format documentation. This text is new,
|
|
176
|
+
but an earlier version from Zeev Tarantov was used as reference.
|
|
177
|
+
|
|
178
|
+
* Only link snappy_unittest against -lz and other autodetected
|
|
179
|
+
libraries, not libsnappy.so (which doesn't need any such dependency).
|
|
180
|
+
|
|
181
|
+
* Fixed some display issues in the microbenchmarks, one of which would
|
|
182
|
+
frequently make the test crash on GNU/Hurd.
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
Snappy v1.0.2, April 29th 2011:
|
|
186
|
+
|
|
187
|
+
* Relicense to a BSD-type license.
|
|
188
|
+
|
|
189
|
+
* Added C bindings, contributed by Martin Gieseking.
|
|
190
|
+
|
|
191
|
+
* More Win32 fixes, in particular for MSVC.
|
|
192
|
+
|
|
193
|
+
* Replace geo.protodata with a newer version.
|
|
194
|
+
|
|
195
|
+
* Fix timing inaccuracies in the unit test when comparing Snappy
|
|
196
|
+
to other algorithms.
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
Snappy v1.0.1, March 25th 2011:
|
|
200
|
+
|
|
201
|
+
This is a maintenance release, mostly containing minor fixes.
|
|
202
|
+
There is no new functionality. The most important fixes include:
|
|
203
|
+
|
|
204
|
+
* The COPYING file and all licensing headers now correctly state that
|
|
205
|
+
Snappy is licensed under the Apache 2.0 license.
|
|
206
|
+
|
|
207
|
+
* snappy_unittest should now compile natively under Windows,
|
|
208
|
+
as well as on embedded systems with no mmap().
|
|
209
|
+
|
|
210
|
+
* Various autotools nits have been fixed.
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
Snappy v1.0, March 17th 2011:
|
|
214
|
+
|
|
215
|
+
* Initial version.
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
Snappy, a fast compressor/decompressor.
|
|
2
|
+
|
|
3
|
+
[](https://github.com/google/snappy/actions/workflows/build.yml)
|
|
4
|
+
|
|
5
|
+
Introduction
|
|
6
|
+
============
|
|
7
|
+
|
|
8
|
+
Snappy is a compression/decompression library. It does not aim for maximum
|
|
9
|
+
compression, or compatibility with any other compression library; instead,
|
|
10
|
+
it aims for very high speeds and reasonable compression. For instance,
|
|
11
|
+
compared to the fastest mode of zlib, Snappy is an order of magnitude faster
|
|
12
|
+
for most inputs, but the resulting compressed files are anywhere from 20% to
|
|
13
|
+
100% bigger. (For more information, see "Performance", below.)
|
|
14
|
+
|
|
15
|
+
Snappy has the following properties:
|
|
16
|
+
|
|
17
|
+
* Fast: Compression speeds at 250 MB/sec and beyond, with no assembler code.
|
|
18
|
+
See "Performance" below.
|
|
19
|
+
* Stable: Over the last few years, Snappy has compressed and decompressed
|
|
20
|
+
petabytes of data in Google's production environment. The Snappy bitstream
|
|
21
|
+
format is stable and will not change between versions.
|
|
22
|
+
* Robust: The Snappy decompressor is designed not to crash in the face of
|
|
23
|
+
corrupted or malicious input.
|
|
24
|
+
* Free and open source software: Snappy is licensed under a BSD-type license.
|
|
25
|
+
For more information, see the included COPYING file.
|
|
26
|
+
|
|
27
|
+
Snappy has previously been called "Zippy" in some Google presentations
|
|
28
|
+
and the like.
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
Performance
|
|
32
|
+
===========
|
|
33
|
+
|
|
34
|
+
Snappy is intended to be fast. On a single core of a Core i7 processor
|
|
35
|
+
in 64-bit mode, it compresses at about 250 MB/sec or more and decompresses at
|
|
36
|
+
about 500 MB/sec or more. (These numbers are for the slowest inputs in our
|
|
37
|
+
benchmark suite; others are much faster.) In our tests, Snappy usually
|
|
38
|
+
is faster than algorithms in the same class (e.g. LZO, LZF, QuickLZ,
|
|
39
|
+
etc.) while achieving comparable compression ratios.
|
|
40
|
+
|
|
41
|
+
Typical compression ratios (based on the benchmark suite) are about 1.5-1.7x
|
|
42
|
+
for plain text, about 2-4x for HTML, and of course 1.0x for JPEGs, PNGs and
|
|
43
|
+
other already-compressed data. Similar numbers for zlib in its fastest mode
|
|
44
|
+
are 2.6-2.8x, 3-7x and 1.0x, respectively. More sophisticated algorithms are
|
|
45
|
+
capable of achieving yet higher compression rates, although usually at the
|
|
46
|
+
expense of speed. Of course, compression ratio will vary significantly with
|
|
47
|
+
the input.
|
|
48
|
+
|
|
49
|
+
Although Snappy should be fairly portable, it is primarily optimized
|
|
50
|
+
for 64-bit x86-compatible processors, and may run slower in other environments.
|
|
51
|
+
In particular:
|
|
52
|
+
|
|
53
|
+
- Snappy uses 64-bit operations in several places to process more data at
|
|
54
|
+
once than would otherwise be possible.
|
|
55
|
+
- Snappy assumes unaligned 32 and 64-bit loads and stores are cheap.
|
|
56
|
+
On some platforms, these must be emulated with single-byte loads
|
|
57
|
+
and stores, which is much slower.
|
|
58
|
+
- Snappy assumes little-endian throughout, and needs to byte-swap data in
|
|
59
|
+
several places if running on a big-endian platform.
|
|
60
|
+
|
|
61
|
+
Experience has shown that even heavily tuned code can be improved.
|
|
62
|
+
Performance optimizations, whether for 64-bit x86 or other platforms,
|
|
63
|
+
are of course most welcome; see "Contact", below.
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
Building
|
|
67
|
+
========
|
|
68
|
+
|
|
69
|
+
You need the CMake version specified in [CMakeLists.txt](./CMakeLists.txt)
|
|
70
|
+
or later to build:
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
git submodule update --init
|
|
74
|
+
mkdir build
|
|
75
|
+
cd build && cmake ../ && make
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Usage
|
|
79
|
+
=====
|
|
80
|
+
|
|
81
|
+
Note that Snappy, both the implementation and the main interface,
|
|
82
|
+
is written in C++. However, several third-party bindings to other languages
|
|
83
|
+
are available; see the [home page](docs/README.md) for more information.
|
|
84
|
+
Also, if you want to use Snappy from C code, you can use the included C
|
|
85
|
+
bindings in snappy-c.h.
|
|
86
|
+
|
|
87
|
+
To use Snappy from your own C++ program, include the file "snappy.h" from
|
|
88
|
+
your calling file, and link against the compiled library.
|
|
89
|
+
|
|
90
|
+
There are many ways to call Snappy, but the simplest possible is
|
|
91
|
+
|
|
92
|
+
```c++
|
|
93
|
+
snappy::Compress(input.data(), input.size(), &output);
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
and similarly
|
|
97
|
+
|
|
98
|
+
```c++
|
|
99
|
+
snappy::Uncompress(input.data(), input.size(), &output);
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
where "input" and "output" are both instances of std::string.
|
|
103
|
+
|
|
104
|
+
There are other interfaces that are more flexible in various ways, including
|
|
105
|
+
support for custom (non-array) input sources. See the header file for more
|
|
106
|
+
information.
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
Tests and benchmarks
|
|
110
|
+
====================
|
|
111
|
+
|
|
112
|
+
When you compile Snappy, the following binaries are compiled in addition to the
|
|
113
|
+
library itself. You do not need them to use the compressor from your own
|
|
114
|
+
library, but they are useful for Snappy development.
|
|
115
|
+
|
|
116
|
+
* `snappy_benchmark` contains microbenchmarks used to tune compression and
|
|
117
|
+
decompression performance.
|
|
118
|
+
* `snappy_unittests` contains unit tests, verifying correctness on your machine
|
|
119
|
+
in various scenarios.
|
|
120
|
+
* `snappy_test_tool` can benchmark Snappy against a few other compression
|
|
121
|
+
libraries (zlib, LZO, LZF, and QuickLZ), if they were detected at configure
|
|
122
|
+
time. To benchmark using a given file, give the compression algorithm you want
|
|
123
|
+
to test Snappy against (e.g. --zlib) and then a list of one or more file names
|
|
124
|
+
on the command line.
|
|
125
|
+
|
|
126
|
+
If you want to change or optimize Snappy, please run the tests and benchmarks to
|
|
127
|
+
verify you have not broken anything.
|
|
128
|
+
|
|
129
|
+
The testdata/ directory contains the files used by the microbenchmarks, which
|
|
130
|
+
should provide a reasonably balanced starting point for benchmarking. (Note that
|
|
131
|
+
baddata[1-3].snappy are not intended as benchmarks; they are used to verify
|
|
132
|
+
correctness in the presence of corrupted data in the unit test.)
|
|
133
|
+
|
|
134
|
+
Contributing to the Snappy Project
|
|
135
|
+
==================================
|
|
136
|
+
|
|
137
|
+
In addition to the aims listed at the top of the [README](README.md) Snappy
|
|
138
|
+
explicitly supports the following:
|
|
139
|
+
|
|
140
|
+
1. C++11
|
|
141
|
+
2. Clang (gcc and MSVC are best-effort).
|
|
142
|
+
3. Low level optimizations (e.g. assembly or equivalent intrinsics) for:
|
|
143
|
+
- [x86](https://en.wikipedia.org/wiki/X86)
|
|
144
|
+
- [x86-64](https://en.wikipedia.org/wiki/X86-64)
|
|
145
|
+
- ARMv7 (32-bit)
|
|
146
|
+
- ARMv8 (AArch64)
|
|
147
|
+
4. Supports only the Snappy compression scheme as described in
|
|
148
|
+
[format_description.txt](format_description.txt).
|
|
149
|
+
5. CMake for building
|
|
150
|
+
|
|
151
|
+
Changes adding features or dependencies outside of the core area of focus listed
|
|
152
|
+
above might not be accepted. If in doubt post a message to the
|
|
153
|
+
[Snappy discussion mailing list](https://groups.google.com/g/snappy-compression).
|
|
154
|
+
|
|
155
|
+
We are unlikely to accept contributions to the build configuration files, such
|
|
156
|
+
as `CMakeLists.txt`. We are focused on maintaining a build configuration that
|
|
157
|
+
allows us to test that the project works in a few supported configurations
|
|
158
|
+
inside Google. We are not currently interested in supporting other requirements,
|
|
159
|
+
such as different operating systems, compilers, or build systems.
|
|
160
|
+
|
|
161
|
+
Contact
|
|
162
|
+
=======
|
|
163
|
+
|
|
164
|
+
Snappy is distributed through GitHub. For the latest version and other
|
|
165
|
+
information, see https://github.com/google/snappy.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Copyright 2023 Google Inc. All Rights Reserved.
|
|
2
|
+
#
|
|
3
|
+
# Redistribution and use in source and binary forms, with or without
|
|
4
|
+
# modification, are permitted provided that the following conditions are
|
|
5
|
+
# met:
|
|
6
|
+
#
|
|
7
|
+
# * Redistributions of source code must retain the above copyright
|
|
8
|
+
# notice, this list of conditions and the following disclaimer.
|
|
9
|
+
# * Redistributions in binary form must reproduce the above
|
|
10
|
+
# copyright notice, this list of conditions and the following disclaimer
|
|
11
|
+
# in the documentation and/or other materials provided with the
|
|
12
|
+
# distribution.
|
|
13
|
+
# * Neither the name of Google Inc. nor the names of its
|
|
14
|
+
# contributors may be used to endorse or promote products derived from
|
|
15
|
+
# this software without specific prior written permission.
|
|
16
|
+
#
|
|
17
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
18
|
+
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
19
|
+
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
20
|
+
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
21
|
+
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
22
|
+
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
23
|
+
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
24
|
+
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
25
|
+
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
26
|
+
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
27
|
+
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
File without changes
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Copyright 2019 Google Inc. All Rights Reserved.
|
|
2
|
+
#
|
|
3
|
+
# Redistribution and use in source and binary forms, with or without
|
|
4
|
+
# modification, are permitted provided that the following conditions are
|
|
5
|
+
# met:
|
|
6
|
+
#
|
|
7
|
+
# * Redistributions of source code must retain the above copyright
|
|
8
|
+
# notice, this list of conditions and the following disclaimer.
|
|
9
|
+
# * Redistributions in binary form must reproduce the above
|
|
10
|
+
# copyright notice, this list of conditions and the following disclaimer
|
|
11
|
+
# in the documentation and/or other materials provided with the
|
|
12
|
+
# distribution.
|
|
13
|
+
# * Neither the name of Google Inc. nor the names of its
|
|
14
|
+
# contributors may be used to endorse or promote products derived from
|
|
15
|
+
# this software without specific prior written permission.
|
|
16
|
+
#
|
|
17
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
18
|
+
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
19
|
+
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
20
|
+
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
21
|
+
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
22
|
+
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
23
|
+
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
24
|
+
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
25
|
+
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
26
|
+
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
27
|
+
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
28
|
+
|
|
29
|
+
@PACKAGE_INIT@
|
|
30
|
+
|
|
31
|
+
include("${CMAKE_CURRENT_LIST_DIR}/SnappyTargets.cmake")
|
|
32
|
+
|
|
33
|
+
check_required_components(Snappy)
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
#ifndef THIRD_PARTY_SNAPPY_OPENSOURCE_CMAKE_CONFIG_H_
|
|
2
|
+
#define THIRD_PARTY_SNAPPY_OPENSOURCE_CMAKE_CONFIG_H_
|
|
3
|
+
|
|
4
|
+
/* Define to 1 if the compiler supports __attribute__((always_inline)). */
|
|
5
|
+
#cmakedefine01 HAVE_ATTRIBUTE_ALWAYS_INLINE
|
|
6
|
+
|
|
7
|
+
/* Define to 1 if the compiler supports __builtin_ctz and friends. */
|
|
8
|
+
#cmakedefine01 HAVE_BUILTIN_CTZ
|
|
9
|
+
|
|
10
|
+
/* Define to 1 if the compiler supports __builtin_expect. */
|
|
11
|
+
#cmakedefine01 HAVE_BUILTIN_EXPECT
|
|
12
|
+
|
|
13
|
+
/* Define to 1 if the compiler supports __builtin_prefetch. */
|
|
14
|
+
#cmakedefine01 HAVE_BUILTIN_PREFETCH
|
|
15
|
+
|
|
16
|
+
/* Define to 1 if you have a definition for mmap() in <sys/mman.h>. */
|
|
17
|
+
#cmakedefine01 HAVE_FUNC_MMAP
|
|
18
|
+
|
|
19
|
+
/* Define to 1 if you have a definition for sysconf() in <unistd.h>. */
|
|
20
|
+
#cmakedefine01 HAVE_FUNC_SYSCONF
|
|
21
|
+
|
|
22
|
+
/* Define to 1 if you have the `lzo2' library (-llzo2). */
|
|
23
|
+
#cmakedefine01 HAVE_LIBLZO2
|
|
24
|
+
|
|
25
|
+
/* Define to 1 if you have the `z' library (-lz). */
|
|
26
|
+
#cmakedefine01 HAVE_LIBZ
|
|
27
|
+
|
|
28
|
+
/* Define to 1 if you have the `lz4' library (-llz4). */
|
|
29
|
+
#cmakedefine01 HAVE_LIBLZ4
|
|
30
|
+
|
|
31
|
+
/* Define to 1 if you have the <sys/mman.h> header file. */
|
|
32
|
+
#cmakedefine01 HAVE_SYS_MMAN_H
|
|
33
|
+
|
|
34
|
+
/* Define to 1 if you have the <sys/resource.h> header file. */
|
|
35
|
+
#cmakedefine01 HAVE_SYS_RESOURCE_H
|
|
36
|
+
|
|
37
|
+
/* Define to 1 if you have the <sys/time.h> header file. */
|
|
38
|
+
#cmakedefine01 HAVE_SYS_TIME_H
|
|
39
|
+
|
|
40
|
+
/* Define to 1 if you have the <sys/uio.h> header file. */
|
|
41
|
+
#cmakedefine01 HAVE_SYS_UIO_H
|
|
42
|
+
|
|
43
|
+
/* Define to 1 if you have the <unistd.h> header file. */
|
|
44
|
+
#cmakedefine01 HAVE_UNISTD_H
|
|
45
|
+
|
|
46
|
+
/* Define to 1 if you have the <windows.h> header file. */
|
|
47
|
+
#cmakedefine01 HAVE_WINDOWS_H
|
|
48
|
+
|
|
49
|
+
/* Define to 1 if you target processors with SSSE3+ and have <tmmintrin.h>. */
|
|
50
|
+
#cmakedefine01 SNAPPY_HAVE_SSSE3
|
|
51
|
+
|
|
52
|
+
/* Define to 1 if you target processors with SSE4.2 and have <crc32intrin.h>. */
|
|
53
|
+
#cmakedefine01 SNAPPY_HAVE_X86_CRC32
|
|
54
|
+
|
|
55
|
+
/* Define to 1 if you target processors with BMI2+ and have <bmi2intrin.h>. */
|
|
56
|
+
#cmakedefine01 SNAPPY_HAVE_BMI2
|
|
57
|
+
|
|
58
|
+
/* Define to 1 if you target processors with NEON and have <arm_neon.h>. */
|
|
59
|
+
#cmakedefine01 SNAPPY_HAVE_NEON
|
|
60
|
+
|
|
61
|
+
/* Define to 1 if you target processors with RVV1.0 and have <riscv_vector.h>. */
|
|
62
|
+
#cmakedefine01 SNAPPY_RVV_1
|
|
63
|
+
|
|
64
|
+
/* Define to 1 if you target processors with RVV0.7 and have <riscv_vector.h>. */
|
|
65
|
+
#cmakedefine01 SNAPPY_RVV_0_7
|
|
66
|
+
|
|
67
|
+
/* Define to 1 if you have <arm_neon.h> and <arm_acle.h> and want to optimize
|
|
68
|
+
compression speed by using __crc32cw from <arm_acle.h>. */
|
|
69
|
+
#cmakedefine01 SNAPPY_HAVE_NEON_CRC32
|
|
70
|
+
|
|
71
|
+
/* Define to 1 if your processor stores words with the most significant byte
|
|
72
|
+
first (like Motorola and SPARC, unlike Intel and VAX). */
|
|
73
|
+
#cmakedefine01 SNAPPY_IS_BIG_ENDIAN
|
|
74
|
+
|
|
75
|
+
#endif // THIRD_PARTY_SNAPPY_OPENSOURCE_CMAKE_CONFIG_H_
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
// Auto-generated config.h for snappy-ruby gem
|
|
2
|
+
// This file provides configuration for bundled Snappy library
|
|
3
|
+
|
|
4
|
+
#ifndef THIRD_PARTY_SNAPPY_OPENSOURCE_CMAKE_CONFIG_H_
|
|
5
|
+
#define THIRD_PARTY_SNAPPY_OPENSOURCE_CMAKE_CONFIG_H_
|
|
6
|
+
|
|
7
|
+
// Define to 1 if the compiler supports __builtin_ctzll
|
|
8
|
+
#if defined(__GNUC__) || defined(__clang__)
|
|
9
|
+
#define HAVE_BUILTIN_CTZ 1
|
|
10
|
+
#endif
|
|
11
|
+
|
|
12
|
+
// Define to 1 if the compiler supports __builtin_expect
|
|
13
|
+
#if defined(__GNUC__) || defined(__clang__)
|
|
14
|
+
#define HAVE_BUILTIN_EXPECT 1
|
|
15
|
+
#endif
|
|
16
|
+
|
|
17
|
+
// Define to 1 if the compiler supports __builtin_prefetch
|
|
18
|
+
#if defined(__GNUC__) || defined(__clang__)
|
|
19
|
+
#define HAVE_BUILTIN_PREFETCH 1
|
|
20
|
+
#endif
|
|
21
|
+
|
|
22
|
+
// Define to 1 if you have <sys/mman.h>
|
|
23
|
+
#if !defined(_WIN32)
|
|
24
|
+
#define HAVE_SYS_MMAN_H 1
|
|
25
|
+
#endif
|
|
26
|
+
|
|
27
|
+
// Define to 1 if you have <sys/resource.h>
|
|
28
|
+
#if !defined(_WIN32)
|
|
29
|
+
#define HAVE_SYS_RESOURCE_H 1
|
|
30
|
+
#endif
|
|
31
|
+
|
|
32
|
+
// Define to 1 if you have <sys/time.h>
|
|
33
|
+
#if !defined(_WIN32)
|
|
34
|
+
#define HAVE_SYS_TIME_H 1
|
|
35
|
+
#endif
|
|
36
|
+
|
|
37
|
+
// Define to 1 if you have <sys/uio.h>
|
|
38
|
+
#if !defined(_WIN32)
|
|
39
|
+
#define HAVE_SYS_UIO_H 1
|
|
40
|
+
#endif
|
|
41
|
+
|
|
42
|
+
// Define to 1 if you have <unistd.h>
|
|
43
|
+
#if !defined(_WIN32)
|
|
44
|
+
#define HAVE_UNISTD_H 1
|
|
45
|
+
#endif
|
|
46
|
+
|
|
47
|
+
// Define to 1 on Windows
|
|
48
|
+
#ifdef _WIN32
|
|
49
|
+
#define HAVE_WINDOWS_H 1
|
|
50
|
+
#endif
|
|
51
|
+
|
|
52
|
+
// Define to 1 if the compiler supports __attribute__((always_inline))
|
|
53
|
+
#if defined(__GNUC__) || defined(__clang__)
|
|
54
|
+
#define HAVE_ATTRIBUTE_ALWAYS_INLINE 1
|
|
55
|
+
#endif
|
|
56
|
+
|
|
57
|
+
// Define to 1 if you have SSSE3 support
|
|
58
|
+
#ifdef __SSSE3__
|
|
59
|
+
#define SNAPPY_HAVE_SSSE3 1
|
|
60
|
+
#endif
|
|
61
|
+
|
|
62
|
+
// Define to 1 if you have x86 CRC32 support
|
|
63
|
+
#ifdef __SSE4_2__
|
|
64
|
+
#define SNAPPY_HAVE_X86_CRC32 1
|
|
65
|
+
#endif
|
|
66
|
+
|
|
67
|
+
// Define to 1 if you have ARM NEON CRC32 support
|
|
68
|
+
#if defined(__ARM_FEATURE_CRC32)
|
|
69
|
+
#define SNAPPY_HAVE_NEON_CRC32 1
|
|
70
|
+
#endif
|
|
71
|
+
|
|
72
|
+
// Define to 1 if your processor stores words with the most significant byte
|
|
73
|
+
// first (like Motorola and SPARC, unlike Intel and VAX).
|
|
74
|
+
#if defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
|
|
75
|
+
#define SNAPPY_IS_BIG_ENDIAN 1
|
|
76
|
+
#endif
|
|
77
|
+
|
|
78
|
+
#endif // THIRD_PARTY_SNAPPY_OPENSOURCE_CMAKE_CONFIG_H_
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
Snappy is a compression/decompression library. It does not aim for maximum
|
|
2
|
+
compression, or compatibility with any other compression library; instead, it
|
|
3
|
+
aims for very high speeds and reasonable compression. For instance, compared
|
|
4
|
+
to the fastest mode of zlib, Snappy is an order of magnitude faster for most
|
|
5
|
+
inputs, but the resulting compressed files are anywhere from 20% to 100%
|
|
6
|
+
bigger. On a single core of a Core i7 processor in 64-bit mode, Snappy
|
|
7
|
+
compresses at about 250 MB/sec or more and decompresses at about 500 MB/sec
|
|
8
|
+
or more.
|
|
9
|
+
|
|
10
|
+
Snappy is widely used inside Google, in everything from BigTable and MapReduce
|
|
11
|
+
to our internal RPC systems. (Snappy has previously been referred to as "Zippy"
|
|
12
|
+
in some presentations and the likes.)
|
|
13
|
+
|
|
14
|
+
For more information, please see the [README](../README.md). Benchmarks against
|
|
15
|
+
a few other compression libraries (zlib, LZO, LZF, FastLZ, and QuickLZ) are
|
|
16
|
+
included in the source code distribution. The source code also contains a
|
|
17
|
+
[formal format specification](../format_description.txt), as well
|
|
18
|
+
as a specification for a [framing format](../framing_format.txt) useful for
|
|
19
|
+
higher-level framing and encapsulation of Snappy data, e.g. for transporting
|
|
20
|
+
Snappy-compressed data across HTTP in a streaming fashion. Note that the Snappy
|
|
21
|
+
distribution currently has no code implementing the latter, but some of the
|
|
22
|
+
ports do (see below).
|
|
23
|
+
|
|
24
|
+
Snappy is written in C++, but C bindings are included, and several bindings to
|
|
25
|
+
other languages are maintained by third parties:
|
|
26
|
+
|
|
27
|
+
* C#: [Snappy for .NET](http://snappy4net.codeplex.com/) (P/Invoke wrapper),
|
|
28
|
+
[Snappy.NET](http://snappy.angeloflogic.com/) (P/Invoke wrapper),
|
|
29
|
+
[Snappy.Sharp](https://github.com/jeffesp/Snappy.Sharp) (native
|
|
30
|
+
reimplementation)
|
|
31
|
+
* [C port](http://github.com/andikleen/snappy-c)
|
|
32
|
+
* [C++ MSVC packaging](http://snappy.angeloflogic.com/) (plus Windows binaries,
|
|
33
|
+
NuGet packages and command-line tool)
|
|
34
|
+
* Common Lisp: [Library bindings](http://flambard.github.com/thnappy/),
|
|
35
|
+
[native reimplementation](https://github.com/brown/snappy)
|
|
36
|
+
* Erlang: [esnappy](https://github.com/thekvs/esnappy),
|
|
37
|
+
[snappy-erlang-nif](https://github.com/fdmanana/snappy-erlang-nif)
|
|
38
|
+
* [Go](https://github.com/golang/snappy/)
|
|
39
|
+
* [Haskell](http://hackage.haskell.org/package/snappy)
|
|
40
|
+
* [Haxe](https://github.com/MaddinXx/hxsnappy) (C++/Neko)
|
|
41
|
+
* [iOS packaging](https://github.com/ideawu/snappy-ios)
|
|
42
|
+
* Java: [JNI wrapper](https://github.com/xerial/snappy-java) (including the
|
|
43
|
+
framing format), [native reimplementation](http://code.google.com/p/jsnappy/),
|
|
44
|
+
[other native reimplementation](https://github.com/dain/snappy) (including
|
|
45
|
+
the framing format)
|
|
46
|
+
* [Lua](https://github.com/forhappy/lua-snappy)
|
|
47
|
+
* [Node.js](https://github.com/kesla/node-snappy) (including the [framing
|
|
48
|
+
format](https://github.com/kesla/node-snappy-stream))
|
|
49
|
+
* [Perl](http://search.cpan.org/dist/Compress-Snappy/)
|
|
50
|
+
* [PHP](https://github.com/kjdev/php-ext-snappy)
|
|
51
|
+
* [Python](http://pypi.python.org/pypi/python-snappy) (including a command-line
|
|
52
|
+
tool for the framing format)
|
|
53
|
+
* [R](https://github.com/lulyon/R-snappy)
|
|
54
|
+
* [Ruby](https://github.com/miyucy/snappy)
|
|
55
|
+
* [Rust](https://github.com/BurntSushi/rust-snappy)
|
|
56
|
+
* [Smalltalk](https://github.com/mumez/sqnappy) (including the framing format)
|
|
57
|
+
|
|
58
|
+
Snappy is used or is available as an alternative in software such as
|
|
59
|
+
|
|
60
|
+
* [MongoDB](https://www.mongodb.com/)
|
|
61
|
+
* [Cassandra](http://cassandra.apache.org/)
|
|
62
|
+
* [Couchbase](http://www.couchbase.com/)
|
|
63
|
+
* [Hadoop](http://hadoop.apache.org/)
|
|
64
|
+
* [LessFS](http://www.lessfs.com/wordpress/)
|
|
65
|
+
* [LevelDB](https://github.com/google/leveldb) (which is in turn used by
|
|
66
|
+
[Google Chrome](http://chrome.google.com/))
|
|
67
|
+
* [Lucene](http://lucene.apache.org/)
|
|
68
|
+
* [VoltDB](http://voltdb.com/)
|
|
69
|
+
|
|
70
|
+
If you know of more, do not hesitate to let us know. The easiest way to get in
|
|
71
|
+
touch is via the
|
|
72
|
+
[Snappy discussion mailing list](http://groups.google.com/group/snappy-compression).
|