snappy 0.2.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.dockerignore +2 -0
- data/.github/workflows/main.yml +2 -2
- data/.gitignore +2 -1
- data/.gitmodules +1 -1
- data/Dockerfile +13 -0
- data/README.md +18 -2
- data/ext/extconf.rb +15 -11
- data/lib/snappy/version.rb +1 -1
- data/snappy.gemspec +1 -0
- data/test.sh +3 -0
- data/vendor/snappy/CMakeLists.txt +150 -27
- data/vendor/snappy/CONTRIBUTING.md +9 -4
- data/vendor/snappy/NEWS +12 -0
- data/vendor/snappy/README.md +52 -35
- data/vendor/snappy/cmake/config.h.in +28 -24
- data/vendor/snappy/snappy-internal.h +189 -25
- data/vendor/snappy/snappy-sinksource.cc +26 -9
- data/vendor/snappy/snappy-sinksource.h +11 -11
- data/vendor/snappy/snappy-stubs-internal.cc +1 -1
- data/vendor/snappy/snappy-stubs-internal.h +227 -308
- data/vendor/snappy/snappy-stubs-public.h.in +0 -11
- data/vendor/snappy/snappy-test.cc +88 -198
- data/vendor/snappy/snappy-test.h +102 -285
- data/vendor/snappy/snappy.cc +1176 -410
- data/vendor/snappy/snappy.h +19 -4
- data/vendor/snappy/snappy_benchmark.cc +378 -0
- data/vendor/snappy/snappy_compress_fuzzer.cc +3 -2
- data/vendor/snappy/snappy_test_data.cc +57 -0
- data/vendor/snappy/snappy_test_data.h +68 -0
- data/vendor/snappy/snappy_test_tool.cc +471 -0
- data/vendor/snappy/snappy_uncompress_fuzzer.cc +3 -2
- data/vendor/snappy/snappy_unittest.cc +170 -666
- metadata +11 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '0907dc377be43ac27d5df46ef70d05ec941ce31e776bb49123532a1a4c1addbd'
|
4
|
+
data.tar.gz: bb3c95ef49930abeef0c5a55c2a5be679ac694c65bcb39264380a8ef9a29ed4d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 99c5b7d50a94ecc9e8729fa42bc1ee57b52f82ae873e1d67f8e858fa24f8a681477b0e4ef0d32e61b337a9fd2d407fbabb5ec3ecb997b948d5ff6ea2261705f4
|
7
|
+
data.tar.gz: 64b38648394f87c5e34ccc519585caee30597bcab11bf20ed110afc7db414f50a53a1c3b1bb35beb329765cae6a3763d016d0888e549f3a1650a72846e882391
|
data/.dockerignore
ADDED
data/.github/workflows/main.yml
CHANGED
@@ -7,10 +7,10 @@ jobs:
|
|
7
7
|
strategy:
|
8
8
|
fail-fast: false
|
9
9
|
matrix:
|
10
|
-
ruby: [2.
|
10
|
+
ruby: [2.7, 3.0, 3.1, 3.2, 3.3, jruby]
|
11
11
|
runs-on: ubuntu-latest
|
12
12
|
steps:
|
13
|
-
- uses: actions/checkout@
|
13
|
+
- uses: actions/checkout@v4
|
14
14
|
with:
|
15
15
|
submodules: true
|
16
16
|
- name: Set up Ruby
|
data/.gitignore
CHANGED
data/.gitmodules
CHANGED
data/Dockerfile
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
# syntax = docker/dockerfile:labs
|
2
|
+
ARG RUBY_VERSION=3.1
|
3
|
+
FROM ruby:${RUBY_VERSION}
|
4
|
+
|
5
|
+
ENV BUNDLE_JOBS=4
|
6
|
+
|
7
|
+
RUN --mount=type=cache,target=/var/cache/apt --mount=type=cache,target=/var/lib/apt <<EOF
|
8
|
+
apt-get update
|
9
|
+
apt-get install -y \
|
10
|
+
cmake
|
11
|
+
EOF
|
12
|
+
|
13
|
+
WORKDIR /app
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Snappy
|
1
|
+
# Snappy
|
2
2
|
|
3
3
|
see https://github.com/google/snappy
|
4
4
|
|
@@ -9,7 +9,7 @@ see https://github.com/google/snappy
|
|
9
9
|
|
10
10
|
```bash
|
11
11
|
$ brew install snappy
|
12
|
-
$ brew install autoconf automake libtool
|
12
|
+
$ brew install autoconf automake cmake libtool
|
13
13
|
```
|
14
14
|
|
15
15
|
### Ubuntu
|
@@ -26,6 +26,22 @@ $ apk install snappy
|
|
26
26
|
$ apk install build-base libexecinfo automake autoconf libtool
|
27
27
|
```
|
28
28
|
|
29
|
+
### Windows
|
30
|
+
|
31
|
+
[Ruby Installer](https://rubyinstaller.org/) 3.0 and earlier:
|
32
|
+
|
33
|
+
```bash
|
34
|
+
(in MSYS2 shell)
|
35
|
+
$ pacman -S mingw-w64-x86_64-snappy
|
36
|
+
```
|
37
|
+
|
38
|
+
Ruby Installer 3.1 and later:
|
39
|
+
|
40
|
+
```bash
|
41
|
+
(in MSYS2 shell)
|
42
|
+
pacman -S mingw-w64-ucrt-x86_64-snappy
|
43
|
+
```
|
44
|
+
|
29
45
|
## Installation
|
30
46
|
|
31
47
|
Add this line to your application's Gemfile:
|
data/ext/extconf.rb
CHANGED
@@ -1,23 +1,27 @@
|
|
1
|
-
require
|
2
|
-
require
|
1
|
+
require "mkmf"
|
2
|
+
require "fileutils"
|
3
3
|
|
4
|
-
|
4
|
+
$CXXFLAGS += " -std=c++11 "
|
5
|
+
|
6
|
+
have_libsnappy = pkg_config("libsnappy") || have_library("snappy")
|
7
|
+
unless have_libsnappy
|
5
8
|
# build vendor/snappy
|
6
9
|
pwd = File.dirname File.expand_path __FILE__
|
7
|
-
dir = File.join pwd,
|
10
|
+
dir = File.join pwd, "..", "vendor", "snappy"
|
8
11
|
|
9
12
|
Dir.chdir(dir) do
|
10
|
-
FileUtils.
|
11
|
-
|
12
|
-
|
13
|
+
FileUtils.rm_rf "build"
|
14
|
+
FileUtils.mkdir_p "build"
|
15
|
+
Dir.chdir(File.join(dir, "build")) do
|
16
|
+
`cmake .. -DCMAKE_BUILD_TYPE=Release -DSNAPPY_BUILD_TESTS=OFF -DSNAPPY_BUILD_BENCHMARKS=OFF`
|
13
17
|
end
|
14
18
|
end
|
15
19
|
|
16
20
|
src = %w[
|
17
21
|
config.h
|
18
22
|
snappy-stubs-public.h
|
19
|
-
].map { |e| File.join dir,
|
20
|
-
FileUtils.cp src, pwd, :
|
23
|
+
].map { |e| File.join dir, "build", e }
|
24
|
+
FileUtils.cp src, pwd, verbose: true
|
21
25
|
src = %w[
|
22
26
|
snappy-c.cc
|
23
27
|
snappy-c.h
|
@@ -29,7 +33,7 @@ unless pkg_config('libsnappy') || have_library('snappy')
|
|
29
33
|
snappy-stubs-internal.cc
|
30
34
|
snappy-stubs-internal.h
|
31
35
|
].map { |e| File.join dir, e }
|
32
|
-
FileUtils.cp src, pwd, :
|
36
|
+
FileUtils.cp src, pwd, verbose: true
|
33
37
|
end
|
34
38
|
|
35
|
-
create_makefile
|
39
|
+
create_makefile "snappy_ext"
|
data/lib/snappy/version.rb
CHANGED
data/snappy.gemspec
CHANGED
data/test.sh
ADDED
@@ -27,7 +27,7 @@
|
|
27
27
|
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
28
28
|
|
29
29
|
cmake_minimum_required(VERSION 3.1)
|
30
|
-
project(Snappy VERSION 1.1.
|
30
|
+
project(Snappy VERSION 1.1.10 LANGUAGES C CXX)
|
31
31
|
|
32
32
|
# C++ standard can be overridden when this is used as a sub-project.
|
33
33
|
if(NOT CMAKE_CXX_STANDARD)
|
@@ -37,12 +37,59 @@ if(NOT CMAKE_CXX_STANDARD)
|
|
37
37
|
set(CMAKE_CXX_EXTENSIONS OFF)
|
38
38
|
endif(NOT CMAKE_CXX_STANDARD)
|
39
39
|
|
40
|
+
# https://github.com/izenecloud/cmake/blob/master/SetCompilerWarningAll.cmake
|
41
|
+
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
42
|
+
# Use the highest warning level for Visual Studio.
|
43
|
+
set(CMAKE_CXX_WARNING_LEVEL 4)
|
44
|
+
if(CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
|
45
|
+
string(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
46
|
+
else(CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
|
47
|
+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
|
48
|
+
endif(CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
|
49
|
+
|
50
|
+
# Disable C++ exceptions.
|
51
|
+
string(REGEX REPLACE "/EH[a-z]+" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
52
|
+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHs-c-")
|
53
|
+
add_definitions(-D_HAS_EXCEPTIONS=0)
|
54
|
+
|
55
|
+
# Disable RTTI.
|
56
|
+
string(REGEX REPLACE "/GR" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
57
|
+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /GR-")
|
58
|
+
else(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
59
|
+
# Use -Wall for clang and gcc.
|
60
|
+
if(NOT CMAKE_CXX_FLAGS MATCHES "-Wall")
|
61
|
+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
|
62
|
+
endif(NOT CMAKE_CXX_FLAGS MATCHES "-Wall")
|
63
|
+
|
64
|
+
# Use -Wextra for clang and gcc.
|
65
|
+
if(NOT CMAKE_CXX_FLAGS MATCHES "-Wextra")
|
66
|
+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wextra")
|
67
|
+
endif(NOT CMAKE_CXX_FLAGS MATCHES "-Wextra")
|
68
|
+
|
69
|
+
# Use -Werror for clang only.
|
70
|
+
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
71
|
+
if(NOT CMAKE_CXX_FLAGS MATCHES "-Werror")
|
72
|
+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
|
73
|
+
endif(NOT CMAKE_CXX_FLAGS MATCHES "-Werror")
|
74
|
+
endif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
75
|
+
|
76
|
+
# Disable C++ exceptions.
|
77
|
+
string(REGEX REPLACE "-fexceptions" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
78
|
+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions")
|
79
|
+
|
80
|
+
# Disable RTTI.
|
81
|
+
string(REGEX REPLACE "-frtti" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
82
|
+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti")
|
83
|
+
endif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
84
|
+
|
40
85
|
# BUILD_SHARED_LIBS is a standard CMake variable, but we declare it here to make
|
41
86
|
# it prominent in the GUI.
|
42
87
|
option(BUILD_SHARED_LIBS "Build shared libraries(DLLs)." OFF)
|
43
88
|
|
44
89
|
option(SNAPPY_BUILD_TESTS "Build Snappy's own tests." ON)
|
45
90
|
|
91
|
+
option(SNAPPY_BUILD_BENCHMARKS "Build Snappy's benchmarks" ON)
|
92
|
+
|
46
93
|
option(SNAPPY_FUZZING_BUILD "Build Snappy for fuzzing." OFF)
|
47
94
|
|
48
95
|
option(SNAPPY_REQUIRE_AVX "Target processors with AVX support." OFF)
|
@@ -55,8 +102,6 @@ include(TestBigEndian)
|
|
55
102
|
test_big_endian(SNAPPY_IS_BIG_ENDIAN)
|
56
103
|
|
57
104
|
include(CheckIncludeFile)
|
58
|
-
check_include_file("byteswap.h" HAVE_BYTESWAP_H)
|
59
|
-
check_include_file("sys/endian.h" HAVE_SYS_ENDIAN_H)
|
60
105
|
check_include_file("sys/mman.h" HAVE_SYS_MMAN_H)
|
61
106
|
check_include_file("sys/resource.h" HAVE_SYS_RESOURCE_H)
|
62
107
|
check_include_file("sys/time.h" HAVE_SYS_TIME_H)
|
@@ -67,6 +112,7 @@ check_include_file("windows.h" HAVE_WINDOWS_H)
|
|
67
112
|
include(CheckLibraryExists)
|
68
113
|
check_library_exists(z zlibVersion "" HAVE_LIBZ)
|
69
114
|
check_library_exists(lzo2 lzo1x_1_15_compress "" HAVE_LIBLZO2)
|
115
|
+
check_library_exists(lz4 LZ4_compress_default "" HAVE_LIBLZ4)
|
70
116
|
|
71
117
|
include(CheckCXXCompilerFlag)
|
72
118
|
CHECK_CXX_COMPILER_FLAG("/arch:AVX" HAVE_VISUAL_STUDIO_ARCH_AVX)
|
@@ -92,6 +138,10 @@ elseif (SNAPPY_REQUIRE_AVX)
|
|
92
138
|
endif(HAVE_CLANG_MAVX)
|
93
139
|
endif(SNAPPY_REQUIRE_AVX2)
|
94
140
|
|
141
|
+
# Used by googletest.
|
142
|
+
check_cxx_compiler_flag(-Wno-missing-field-initializers
|
143
|
+
SNAPPY_HAVE_NO_MISSING_FIELD_INITIALIZERS)
|
144
|
+
|
95
145
|
include(CheckCXXSourceCompiles)
|
96
146
|
check_cxx_source_compiles("
|
97
147
|
int main() {
|
@@ -103,6 +153,13 @@ int main() {
|
|
103
153
|
return __builtin_ctzll(0);
|
104
154
|
}" HAVE_BUILTIN_CTZ)
|
105
155
|
|
156
|
+
check_cxx_source_compiles("
|
157
|
+
__attribute__((always_inline)) int zero() { return 0; }
|
158
|
+
|
159
|
+
int main() {
|
160
|
+
return zero();
|
161
|
+
}" HAVE_ATTRIBUTE_ALWAYS_INLINE)
|
162
|
+
|
106
163
|
check_cxx_source_compiles("
|
107
164
|
#include <tmmintrin.h>
|
108
165
|
|
@@ -115,26 +172,38 @@ int main() {
|
|
115
172
|
return 0;
|
116
173
|
}" SNAPPY_HAVE_SSSE3)
|
117
174
|
|
175
|
+
check_cxx_source_compiles("
|
176
|
+
#include <immintrin.h>
|
177
|
+
int main() {
|
178
|
+
return _mm_crc32_u32(0, 1);
|
179
|
+
}" SNAPPY_HAVE_X86_CRC32)
|
180
|
+
|
181
|
+
check_cxx_source_compiles("
|
182
|
+
#include <arm_neon.h>
|
183
|
+
#include <arm_acle.h>
|
184
|
+
int main() {
|
185
|
+
return __crc32cw(0, 1);
|
186
|
+
}" SNAPPY_HAVE_NEON_CRC32)
|
187
|
+
|
118
188
|
check_cxx_source_compiles("
|
119
189
|
#include <immintrin.h>
|
120
190
|
int main() {
|
121
191
|
return _bzhi_u32(0, 1);
|
122
192
|
}" SNAPPY_HAVE_BMI2)
|
123
193
|
|
194
|
+
check_cxx_source_compiles("
|
195
|
+
#include <arm_neon.h>
|
196
|
+
int main() {
|
197
|
+
uint8_t val = 3, dup[8];
|
198
|
+
uint8x16_t v = vld1q_dup_u8(&val);
|
199
|
+
vst1q_u8(dup, v);
|
200
|
+
return 0;
|
201
|
+
}" SNAPPY_HAVE_NEON)
|
202
|
+
|
124
203
|
include(CheckSymbolExists)
|
125
204
|
check_symbol_exists("mmap" "sys/mman.h" HAVE_FUNC_MMAP)
|
126
205
|
check_symbol_exists("sysconf" "unistd.h" HAVE_FUNC_SYSCONF)
|
127
206
|
|
128
|
-
find_package(GTest QUIET)
|
129
|
-
if(GTEST_FOUND)
|
130
|
-
set(HAVE_GTEST 1)
|
131
|
-
endif(GTEST_FOUND)
|
132
|
-
|
133
|
-
find_package(Gflags QUIET)
|
134
|
-
if(GFLAGS_FOUND)
|
135
|
-
set(HAVE_GFLAGS 1)
|
136
|
-
endif(GFLAGS_FOUND)
|
137
|
-
|
138
207
|
configure_file(
|
139
208
|
"cmake/config.h.in"
|
140
209
|
"${PROJECT_BINARY_DIR}/config.h"
|
@@ -202,38 +271,92 @@ if(BUILD_SHARED_LIBS)
|
|
202
271
|
set_target_properties(snappy PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON)
|
203
272
|
endif(BUILD_SHARED_LIBS)
|
204
273
|
|
205
|
-
if(SNAPPY_BUILD_TESTS)
|
206
|
-
|
207
|
-
|
208
|
-
add_executable(snappy_unittest "")
|
209
|
-
target_sources(snappy_unittest
|
274
|
+
if(SNAPPY_BUILD_TESTS OR SNAPPY_BUILD_BENCHMARKS)
|
275
|
+
add_library(snappy_test_support "")
|
276
|
+
target_sources(snappy_test_support
|
210
277
|
PRIVATE
|
211
|
-
"snappy_unittest.cc"
|
212
278
|
"snappy-test.cc"
|
279
|
+
"snappy-test.h"
|
280
|
+
"snappy_test_data.cc"
|
281
|
+
"snappy_test_data.h"
|
282
|
+
"${PROJECT_BINARY_DIR}/config.h"
|
213
283
|
)
|
214
|
-
|
215
|
-
|
284
|
+
|
285
|
+
# Test files include snappy-test.h, HAVE_CONFIG_H must be defined.
|
286
|
+
target_compile_definitions(snappy_test_support PUBLIC -DHAVE_CONFIG_H)
|
287
|
+
|
288
|
+
target_link_libraries(snappy_test_support snappy)
|
216
289
|
|
217
290
|
if(HAVE_LIBZ)
|
218
|
-
target_link_libraries(
|
291
|
+
target_link_libraries(snappy_test_support z)
|
219
292
|
endif(HAVE_LIBZ)
|
220
293
|
if(HAVE_LIBLZO2)
|
221
|
-
target_link_libraries(
|
294
|
+
target_link_libraries(snappy_test_support lzo2)
|
222
295
|
endif(HAVE_LIBLZO2)
|
296
|
+
if(HAVE_LIBLZ4)
|
297
|
+
target_link_libraries(snappy_test_support lz4)
|
298
|
+
endif(HAVE_LIBLZ4)
|
223
299
|
|
224
|
-
target_include_directories(
|
225
|
-
BEFORE
|
300
|
+
target_include_directories(snappy_test_support
|
301
|
+
BEFORE PUBLIC
|
226
302
|
"${PROJECT_SOURCE_DIR}"
|
227
|
-
"${GTEST_INCLUDE_DIRS}"
|
228
|
-
"${GFLAGS_INCLUDE_DIRS}"
|
229
303
|
)
|
304
|
+
endif(SNAPPY_BUILD_TESTS OR SNAPPY_BUILD_BENCHMARKS)
|
305
|
+
|
306
|
+
if(SNAPPY_BUILD_TESTS)
|
307
|
+
enable_testing()
|
308
|
+
|
309
|
+
# Prevent overriding the parent project's compiler/linker settings on Windows.
|
310
|
+
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
|
311
|
+
set(install_gtest OFF)
|
312
|
+
set(install_gmock OFF)
|
313
|
+
set(build_gmock ON)
|
314
|
+
|
315
|
+
# This project is tested using GoogleTest.
|
316
|
+
add_subdirectory("third_party/googletest")
|
317
|
+
|
318
|
+
# GoogleTest triggers a missing field initializers warning.
|
319
|
+
if(SNAPPY_HAVE_NO_MISSING_FIELD_INITIALIZERS)
|
320
|
+
set_property(TARGET gtest
|
321
|
+
APPEND PROPERTY COMPILE_OPTIONS -Wno-missing-field-initializers)
|
322
|
+
set_property(TARGET gmock
|
323
|
+
APPEND PROPERTY COMPILE_OPTIONS -Wno-missing-field-initializers)
|
324
|
+
endif(SNAPPY_HAVE_NO_MISSING_FIELD_INITIALIZERS)
|
325
|
+
|
326
|
+
add_executable(snappy_unittest "")
|
327
|
+
target_sources(snappy_unittest
|
328
|
+
PRIVATE
|
329
|
+
"snappy_unittest.cc"
|
330
|
+
)
|
331
|
+
target_link_libraries(snappy_unittest snappy_test_support gmock_main gtest)
|
230
332
|
|
231
333
|
add_test(
|
232
334
|
NAME snappy_unittest
|
233
335
|
WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}"
|
234
336
|
COMMAND "${PROJECT_BINARY_DIR}/snappy_unittest")
|
337
|
+
|
338
|
+
add_executable(snappy_test_tool "")
|
339
|
+
target_sources(snappy_test_tool
|
340
|
+
PRIVATE
|
341
|
+
"snappy_test_tool.cc"
|
342
|
+
)
|
343
|
+
target_link_libraries(snappy_test_tool snappy_test_support)
|
235
344
|
endif(SNAPPY_BUILD_TESTS)
|
236
345
|
|
346
|
+
if(SNAPPY_BUILD_BENCHMARKS)
|
347
|
+
add_executable(snappy_benchmark "")
|
348
|
+
target_sources(snappy_benchmark
|
349
|
+
PRIVATE
|
350
|
+
"snappy_benchmark.cc"
|
351
|
+
)
|
352
|
+
target_link_libraries(snappy_benchmark snappy_test_support benchmark_main)
|
353
|
+
|
354
|
+
# This project uses Google benchmark for benchmarking.
|
355
|
+
set(BENCHMARK_ENABLE_TESTING OFF CACHE BOOL "" FORCE)
|
356
|
+
set(BENCHMARK_ENABLE_EXCEPTIONS OFF CACHE BOOL "" FORCE)
|
357
|
+
add_subdirectory("third_party/benchmark")
|
358
|
+
endif(SNAPPY_BUILD_BENCHMARKS)
|
359
|
+
|
237
360
|
if(SNAPPY_FUZZING_BUILD)
|
238
361
|
add_executable(snappy_compress_fuzzer "")
|
239
362
|
target_sources(snappy_compress_fuzzer
|
@@ -6,7 +6,7 @@ just a few small guidelines you need to follow.
|
|
6
6
|
## Contributor License Agreement
|
7
7
|
|
8
8
|
Contributions to this project must be accompanied by a Contributor License
|
9
|
-
Agreement. You (or your employer) retain the copyright to your contribution
|
9
|
+
Agreement. You (or your employer) retain the copyright to your contribution;
|
10
10
|
this simply gives us permission to use and redistribute your contributions as
|
11
11
|
part of the project. Head over to <https://cla.developers.google.com/> to see
|
12
12
|
your current agreements on file or to sign a new one.
|
@@ -15,12 +15,17 @@ You generally only need to submit a CLA once, so if you've already submitted one
|
|
15
15
|
(even if it was for a different project), you probably don't need to do it
|
16
16
|
again.
|
17
17
|
|
18
|
-
## Code
|
18
|
+
## Code Reviews
|
19
19
|
|
20
20
|
All submissions, including submissions by project members, require review. We
|
21
21
|
use GitHub pull requests for this purpose. Consult
|
22
22
|
[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more
|
23
23
|
information on using pull requests.
|
24
24
|
|
25
|
-
|
26
|
-
|
25
|
+
See [the README](README.md#contributing-to-the-snappy-project) for areas
|
26
|
+
where we are likely to accept external contributions.
|
27
|
+
|
28
|
+
## Community Guidelines
|
29
|
+
|
30
|
+
This project follows [Google's Open Source Community
|
31
|
+
Guidelines](https://opensource.google/conduct/).
|
data/vendor/snappy/NEWS
CHANGED
@@ -1,3 +1,15 @@
|
|
1
|
+
Snappy v1.1.10, Mar 8th 2023:
|
2
|
+
|
3
|
+
* Performance improvements
|
4
|
+
|
5
|
+
* Compilation fixes for various environments
|
6
|
+
|
7
|
+
Snappy v1.1.9, May 4th 2021:
|
8
|
+
|
9
|
+
* Performance improvements.
|
10
|
+
|
11
|
+
* Google Test and Google Benchmark are now bundled in third_party/.
|
12
|
+
|
1
13
|
Snappy v1.1.8, January 15th 2020:
|
2
14
|
|
3
15
|
* Small performance improvements.
|
data/vendor/snappy/README.md
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
Snappy, a fast compressor/decompressor.
|
2
2
|
|
3
|
+
[![Build Status](https://github.com/google/snappy/actions/workflows/build.yml/badge.svg)](https://github.com/google/snappy/actions/workflows/build.yml)
|
3
4
|
|
4
5
|
Introduction
|
5
6
|
============
|
@@ -69,6 +70,7 @@ You need the CMake version specified in [CMakeLists.txt](./CMakeLists.txt)
|
|
69
70
|
or later to build:
|
70
71
|
|
71
72
|
```bash
|
73
|
+
git submodule update --init
|
72
74
|
mkdir build
|
73
75
|
cd build && cmake ../ && make
|
74
76
|
```
|
@@ -107,42 +109,57 @@ information.
|
|
107
109
|
Tests and benchmarks
|
108
110
|
====================
|
109
111
|
|
110
|
-
When you compile Snappy,
|
111
|
-
library itself. You do not need
|
112
|
-
but
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
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
|
+
1. [x86](https://en.wikipedia.org/wiki/X86)
|
144
|
+
2. [x86-64](https://en.wikipedia.org/wiki/X86-64)
|
145
|
+
3. ARMv7 (32-bit)
|
146
|
+
4. 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.
|
143
160
|
|
144
161
|
Contact
|
145
162
|
=======
|
146
163
|
|
147
|
-
Snappy is distributed through GitHub. For the latest version
|
148
|
-
|
164
|
+
Snappy is distributed through GitHub. For the latest version and other
|
165
|
+
information, see https://github.com/google/snappy.
|