snappy_unittestをやってみたよ

DSIRNLPの発表にあったsnappyは全く知らなかったので,大変参考になりました.かなり速いマシンで,snappy_unittestをやってみました.

コンパイルでちょっとはまったのは,GTEST_CONFIG環境変数に,google testのgtest_configへのパスを設定してからconfigureしないとコンパイルが通りませんでした.
また,以下のgflagsも必要なようです.

google testのインストールは,1.6.0からmake installではなくてちょっと一手間かかるようになっているので(google testのreadmeなどを参照),gtest-1.6.0は入っているものとして,たぶん,これでsnappy_unittestが試せると思います.

tar zvxf gflags-1.5.0.tar.gz
tar zxvf snappy-1.0.3.tar.gz
cd gflags-1.5.0
./configure --prefix=~/usr/local
make
make install
cd ..
cd snappy-1.0.3
GTEST_CONFIG=gtest-1.6.0/scripts/へのパス; ./configure --prefix=~/usr/local
make
make install
./snappy_unittest

./snappy_unittestの結果:

Running microbenchmarks.
WARNING: Compiled with assertions enabled, will be slow.
Benchmark            Time(ns)    CPU(ns) Iterations
                                                                                                    • -
BM_UFlat/0 62529 62448 1489 1.5GB/s html BM_UFlat/1 642063 641690 268 1.0GB/s urls BM_UFlat/2 9670 9661 20491 12.2GB/s jpg BM_UFlat/3 25616 25693 3619 3.4GB/s pdf BM_UFlat/4 252631 252638 467 1.5GB/s html4 BM_UFlat/5 25017 24965 8210 939.8MB/s cp BM_UFlat/6 10766 10768 18570 987.5MB/s c BM_UFlat/7 3401 3393 23866 1.0GB/s lsp BM_UFlat/8 959264 960528 178 1022.4MB/s xls BM_UFlat/9 197300 197522 572 734.3MB/s txt1 BM_UFlat/10 170729 171082 713 697.8MB/s txt2 BM_UFlat/11 523052 523450 340 777.5MB/s txt3 BM_UFlat/12 703270 706000 262 650.9MB/s txt4 BM_UFlat/13 301134 300784 482 1.6GB/s bin BM_UFlat/14 40605 40711 2284 895.8MB/s sum BM_UFlat/15 4486 4477 20768 900.3MB/s man BM_UFlat/16 66576 66546 3035 1.7GB/s pb BM_UFlat/17 200036 198865 543 883.9MB/s gaviota BM_UValidate/0 35930 35927 5538 2.7GB/s html BM_UValidate/1 407379 408102 490 1.6GB/s urls BM_UValidate/2 188 188 833333 627.7GB/s jpg BM_UValidate/3 12332 12298 15772 7.1GB/s pdf BM_UValidate/4 144234 144069 1388 2.6GB/s html4 BM_ZFlat/0 258448 258402 770 377.9MB/s html (23.57 %) BM_ZFlat/1 2720520 2719580 100 246.2MB/s urls (50.89 %) BM_ZFlat/2 30047 29972 6605 3.9GB/s jpg (99.88 %) BM_ZFlat/3 103862 103975 1904 865.2MB/s pdf (82.13 %) BM_ZFlat/4 1017405 1020358 195 382.8MB/s html4 (23.55 %) BM_ZFlat/5 105378 105219 1891 223.0MB/s cp (48.12 %) BM_ZFlat/6 48175 48191 4108 220.7MB/s c (42.40 %) BM_ZFlat/7 15026 15018 12383 236.3MB/s lsp (48.37 %) BM_ZFlat/8 3555570 3559460 100 275.9MB/s xls (41.34 %) BM_ZFlat/9 903509 904404 220 160.4MB/s txt1 (59.81 %) BM_ZFlat/10 772980 772084 259 154.6MB/s txt2 (64.07 %) BM_ZFlat/11 2399410 2399640 100 169.6MB/s txt3 (57.11 %) BM_ZFlat/12 3173020 3169520 100 145.0MB/s txt4 (68.35 %) BM_ZFlat/13 1005974 1004898 198 487.1MB/s bin (18.21 %) BM_ZFlat/14 166759 167058 1197 218.3MB/s sum (51.88 %) BM_ZFlat/15 20407 20352 9285 198.1MB/s man (59.36 %) BM_ZFlat/16 262335 262147 759 431.4MB/s pb (23.15 %) BM_ZFlat/17 834067 835316 237 210.4MB/s gaviota (38.27 %) Running correctness tests. Crazy decompression lengths not checked on 64-bit build All tests passed.