Giter Club home page Giter Club logo

erlav's Introduction

erlav

High performance avro encoding/decoding NIF-based library

Build

$ rebar3 compile
$ rebar3 eunit

Usage

SchemaId = erlav_nif:erlav_init(<<"priv/tschema2.avsc">>),
Term = #{
        <<"intField">> => 789,
        <<"longField">> => 2989898111,
        <<"doubleField">> => 11.2345,
        <<"floatField">> => 23.12,
        <<"boolField">> => true,
        <<"stringField">> => <<"asdadasdasdasd3453534dfgdgd123456789">>,
        <<"bytesField">> => <<1,99,57,127,0,56>>
},

% Encode Term to avro format
Ret = erlav_nif:erlav_encode(SchemaId, Term),

% Decode data in avro format to erlang term
DecodedTerm = erlav_nif:erlav_decode_fast(SchemaId, Ret)

Performance

run erlang shell

erl -pa _build/default/lib/*/ebin

run performance test ( it will generate report at the end )

erlav_perf:all_tests().
Test name erlavro time erlav time
erlav_perf_tst2 746.0727 142.3787
erlav_perf_tst3 1591.4327 250.2485
map_perf_tst1 1069.9354 331.2828
map_perf_tst2 217.3632 70.7547
array_int_perf_tst 20.8804 3.9581
array_str_perf_tst 152.1964 33.9999
array_map_perf_tst 363.2405 120.0964

erlav's People

Contributors

mijkenator avatar antoinegagne avatar x0id avatar

Watchers

 avatar

erlav's Issues

support map of arrays

 {
        "name": "filtered_app_compatible_result",
        "type": ["null", {
            "name": "filtered_app_compatible_result_map",
            "type": "map",
            "values": {
                "type": "array",
                "items": "long"
            }
        }],
        "default": null
    },

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.