Skip to content
This repository

Erlang bindings for Google's Snappy compression library.

tree: 4e5b2985a4

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 c_src
Octocat-spinner-32 src
Octocat-spinner-32 test
Octocat-spinner-32 README.md
Octocat-spinner-32 rebar
Octocat-spinner-32 rebar.config
README.md

Description

The esnappy library provides Erlang bindings to Google's Snappy compression library. It uses separate thread for compression/decompression so it won't screw up Erlang's VM scheduler while processing large binaries. Code of the Snappy library included in this distribution.

Erlang Version

The esnappy library requires Erlang R14B or later.

Perfomance

Erlang R14B02 (erts-5.8.3) [source] [64-bit] [smp:4:4] [rq:4] [async-threads:0] [hipe] [kernel-poll:false]

Eshell V5.8.3  (abort with ^G)
1> code:add_path("ebin").
true
2> {ok, Data} = file:read_file("test/text.txt").
{ok,>}
3> {ok, Ctx} = esnappy:create_ctx().
{ok,>}
4> {ST, {ok, SCompressed}} = timer:tc(esnappy, compress, [Ctx, Data]).
{46692,
 {ok,>}}
5> {ZT, ZCompressed} = timer:tc(zlib, zip, [Data]).
{493585,
 >}
6> size(Data).
3072089
7> size(SCompressed).
1548017
8> size(ZCompressed).
832898
Something went wrong with that request. Please try again.