MessagePack (de)serializer implementation for Erlang / msgpack.org[Erlang]
Go to file
2013-09-11 00:55:00 +09:00
include add pack/unpack options 2013-09-11 00:55:00 +09:00
src add pack/unpack options 2013-09-11 00:55:00 +09:00
test add pack/unpack options 2013-09-11 00:55:00 +09:00
.gitignore update .gitignore 2013-02-18 05:07:51 +09:00
.travis.yml add R16B support (just tested) 2013-07-07 00:25:35 +09:00
LICENSE-2.0.txt add license terms and a bit cosme 2011-05-02 17:29:00 +09:00
Makefile merge string branch and go to new spec, for str type. TODO: ext types and nif types. in favor of #16 2013-09-10 00:17:16 +09:00
README.rst add pack/unpack options 2013-09-11 00:55:00 +09:00
rebar update rebar 2013-02-02 21:00:35 +09:00
rebar.config merge string branch and go to new spec, for str type. TODO: ext types and nif types. in favor of #16 2013-09-10 00:17:16 +09:00

##################
MessagePack Erlang
##################

.. image:: https://secure.travis-ci.org/msgpack/msgpack-erlang.png

.. image:: https://drone.io/github.com/msgpack/msgpack-erlang/status.png

prequisites for runtime
-----------------------

`Erlang runtime system <http://erlang.org/>`_ , >= R15B -- otherwise rebar won't work.
Based on `the new msgpack spec 232a0d <https://github.com/msgpack/msgpack/blob/232a0d14c6057000cc4a478f0dfbb5942ac54e9e/spec.md>`_ .

Now this supports string type.

::

  1> {ok, "埼玉"} = msgpack:unpack(msgpack:pack("埼玉")).
  {ok,[22524,29577]}


There are several options for `msgpack:pack/2` and `msgpack:unpack/2` .
See `msgpack_list_options()` in `msgpack.hrl`.


rebar.config
------------

::

   {deps, [
     {msgpack, ".*",
       {git, "git://github.com/msgpack/msgpack-erlang.git", "master"}}
   ]}.

Simple deserialization

::

   Ham = msgpack:pack(Spam),
   {ok, Spam} = msgpack:unpack(Ham).

Stream deserialization

::

   {Term0, Rest0} = msgpack:unpack_stream(Binary),
   {Term1, Rest1} = msgpack:unpack_stream(Rest0),
   ...

experimental feature: NIF (de)serializer
----------------------------------------

**Currently NIF is unavailable on both new and old spec.**

since 0.1.1 - only tested in MacOS, Linux

::

  test/bench_tests.erl:36:<0.125.0>:   serialize: 0.543 s
  test/bench_tests.erl:37:<0.125.0>: deserialize: 0.653 s
  test/bench_tests.erl:38:<0.125.0>: for 2041 KB test data(jiffy).
  test/bench_tests.erl:42:<0.125.0>:   serialize: 0.508 s
  test/bench_tests.erl:43:<0.125.0>: deserialize: 0.630 s
  test/bench_tests.erl:44:<0.125.0>: for 2041 KB test data(jsx).
  test/bench_tests.erl:54:<0.125.0>:   serialize: 0.063 s
  test/bench_tests.erl:55:<0.125.0>: deserialize: 0.053 s
  test/bench_tests.erl:56:<0.125.0>: for 3828 KB test data(t2b/b2t).
  test/bench_tests.erl:75:<0.125.0>:    serialize: 1.332 s
  test/bench_tests.erl:87:<0.125.0>:  deserialize: 1.601 s
  test/bench_tests.erl:88:<0.125.0>: for 2041 KB test data(jiffy x 5).
  test/bench_tests.erl:75:<0.125.0>:    serialize: 1.243 s
  test/bench_tests.erl:87:<0.125.0>:  deserialize: 3.233 s
  test/bench_tests.erl:88:<0.125.0>: for 2041 KB test data(jsx x 5).
  test/bench_tests.erl:75:<0.125.0>:    serialize: 0.076 s
  test/bench_tests.erl:87:<0.125.0>:  deserialize: 0.061 s
  test/bench_tests.erl:88:<0.125.0>: for 3828 KB test data(t2b/b2t x 5).


License
-------

Apache License 2.0