<s>
Snappy	B-Language
(	O
previously	O
known	O
as	O
Zippy	O
)	O
is	O
a	O
fast	O
data	B-General_Concept
compression	I-General_Concept
and	O
decompression	B-General_Concept
library	O
written	O
in	O
C++	B-Language
by	O
Google	B-Application
based	O
on	O
ideas	O
from	O
LZ77	O
and	O
open-sourced	O
in	O
2011	O
.	O
</s>
<s>
Compression	O
speed	O
is	O
250	O
MB/s	O
and	O
decompression	B-General_Concept
speed	O
is	O
500	O
MB/s	O
using	O
a	O
single	O
core	O
of	O
a	O
circa	O
2011	O
"	O
Westmere	O
"	O
2.26	O
GHz	O
Core	O
i7	O
processor	O
running	O
in	O
64-bit	B-Device
mode	I-Device
.	O
</s>
<s>
The	O
compression	B-General_Concept
ratio	I-General_Concept
is	O
20	O
–	O
100%	O
lower	O
than	O
gzip	B-Application
.	O
</s>
<s>
Snappy	B-Language
is	O
widely	O
used	O
in	O
Google	B-Application
projects	O
like	O
Bigtable	B-Application
,	O
MapReduce	B-Operating_System
and	O
in	O
compressing	O
data	O
for	O
Google	B-Application
's	I-Application
internal	O
RPC	B-Operating_System
systems	O
.	O
</s>
<s>
It	O
can	O
be	O
used	O
in	O
open-source	O
projects	O
like	O
MariaDB	B-Application
ColumnStore	I-Application
,	O
Cassandra	B-Application
,	O
Couchbase	B-Operating_System
,	O
Hadoop	B-Application
,	O
LevelDB	B-Language
,	O
MongoDB	B-Application
,	O
RocksDB	B-Language
,	O
Lucene	B-Language
,	O
Spark	B-Language
,	O
and	O
InfluxDB	B-Language
.	O
</s>
<s>
Decompression	B-General_Concept
is	O
tested	O
to	O
detect	O
any	O
errors	O
in	O
the	O
compressed	O
stream	O
.	O
</s>
<s>
Snappy	B-Language
does	O
not	O
use	O
inline	B-Language
assembler	I-Language
(	O
except	O
some	O
optimizations	O
)	O
and	O
is	O
portable	O
.	O
</s>
<s>
Snappy	B-Language
encoding	O
is	O
not	O
bit-oriented	O
,	O
but	O
byte-oriented	O
(	O
only	O
whole	O
bytes	O
are	O
emitted	O
or	O
consumed	O
from	O
a	O
stream	O
)	O
.	O
</s>
<s>
The	O
format	O
uses	O
no	O
entropy	B-Algorithm
encoder	I-Algorithm
,	O
like	O
Huffman	B-General_Concept
tree	I-General_Concept
or	O
arithmetic	B-Algorithm
encoder	I-Algorithm
.	O
</s>
<s>
The	O
first	O
bytes	O
of	O
the	O
stream	O
are	O
the	O
length	O
of	O
uncompressed	B-General_Concept
data	O
,	O
stored	O
as	O
a	O
little-endian	O
varint	O
,	O
which	O
allows	O
for	O
use	O
of	O
a	O
variable-length	B-Algorithm
code	I-Algorithm
.	O
</s>
<s>
00	O
–	O
Literal	O
–	O
uncompressed	B-General_Concept
data	O
;	O
upper	O
6	O
bits	O
are	O
used	O
to	O
store	O
length	O
(	O
len-1	O
)	O
of	O
data	O
.	O
</s>
<s>
The	O
size	O
of	O
the	O
dictionary	O
was	O
limited	O
by	O
the	O
1.0	O
Snappy	B-Language
compressor	O
to	O
32,768	O
bytes	O
,	O
and	O
updated	O
to	O
65,536	O
in	O
version	O
1.1	O
.	O
</s>
<s>
The	O
complete	O
official	O
description	O
of	O
the	O
snappy	B-Language
format	O
can	O
be	O
found	O
in	O
the	B-Application
google	I-Application
GitHub	B-Application
repository	O
.	O
</s>
<s>
The	O
first	O
2	O
bytes	O
,	O
ca02	O
are	O
the	O
length	O
,	O
as	O
a	O
little-endian	O
varint	O
(	O
see	O
Protocol	B-Protocol
Buffers	I-Protocol
for	O
the	O
varint	O
specification	O
)	O
.	O
</s>
<s>
Unlike	O
compression	O
methods	O
such	O
as	O
gzip	B-Application
and	O
bzip2	O
,	O
there	O
is	O
no	O
entropy	B-Algorithm
encoding	I-Algorithm
used	O
to	O
pack	O
alphabet	O
into	O
the	O
bit	O
stream	O
.	O
</s>
<s>
Snappy	B-Language
distributions	O
include	O
C++	B-Language
and	O
C	O
bindings	O
.	O
</s>
<s>
Third	O
party-provided	O
bindings	O
and	O
ports	O
include	O
C#	B-Application
,	O
Common	B-Language
Lisp	I-Language
,	O
Crystal	O
(	O
programming	O
language	O
)	O
,	O
Erlang	B-Operating_System
,	O
Go	B-Application
,	O
Haskell	B-Language
,	O
Lua	B-Language
,	O
Java	B-Language
,	O
Nim	B-Application
,	O
Node.js	B-Language
,	O
Perl	B-Language
,	O
PHP	B-Application
,	O
Python	B-Language
,	O
R	B-Language
,	O
Ruby	B-Language
,	O
Rust	B-Application
,	O
Smalltalk	B-Application
,	O
and	O
OpenCL	B-Application
.	O
</s>
