Git Product home page Git Product logo

exomler's Introduction

Exomler

Build Status Coverage Status

Exomler is a fast and simple DOM XML parser. It is super fast, convenient and has very low memory footprint. Really!

Usage

Examples of decoding

Decode (attributes as proplists, default behaviour):

1> XML = <<"<html key=\"value\">Body</html>">>.

2> exomler:decode(XML).
{<<"html">>, [{<<"key">>, <<"value">>}], [<<"Body">>]}

Decode (attributes as maps)

1> XML = <<"<html key=\"value\">Body</html>">>.

2> exomler:decode(XML, #{attributes => map}).
{<<"html">>,#{<<"key">> => <<"value">>},[<<"Body">>]}

Examples of encoding

1> Xml = {<<"html">>,#{<<"key">> => <<"value">>},[<<"Body">>]}.
2> exomler:encode(Xml).
<<"<html key=\"value\">Body</html>">>

Benchmarking

Decoding

./exomler_bench test_01.xml 1000
-------------------------------------------------------
     parser    min time  total time    memory     speed
-------------------------------------------------------
      xmerl      146mcs      200mls      73KB     1MB/s
     erlsom       34mcs       78mls      20KB     3MB/s
    exomler       22mcs       57mls      20KB     5MB/s
   mochiweb       56mcs       95mls       8KB     3MB/s
-------------------------------------------------------
./exomler_bench test_02.xml 1000
-------------------------------------------------------
     parser    min time  total time    memory     speed
-------------------------------------------------------
      xmerl      400mcs      453mls     159KB     2MB/s
     erlsom       98mcs      140mls     106KB     7MB/s
    exomler       59mcs       91mls      41KB    12MB/s
   mochiweb      190mcs      249mls      53KB     4MB/s
-------------------------------------------------------
./exomler_bench test_03.xml 1000
-------------------------------------------------------
     parser    min time  total time    memory     speed
-------------------------------------------------------
      xmerl     1720mcs     1933mls     672KB     2MB/s
     erlsom      634mcs      707mls     171KB     6MB/s
    exomler      397mcs      519mls     139KB     9MB/s
   mochiweb      993mcs     1135mls     277KB     4MB/s
-------------------------------------------------------
./exomler_bench test_04.xml 1000
-------------------------------------------------------
     parser    min time  total time    memory     speed
-------------------------------------------------------
      xmerl     3622mcs     3953mls    2845KB     5MB/s
     erlsom     1735mcs     1926mls    1087KB    11MB/s
    exomler      336mcs      380mls     139KB    56MB/s
   mochiweb     1712mcs     1883mls     257KB    11MB/s
-------------------------------------------------------

exomler's People

Contributors

kostiushkin avatar maxlapshin avatar bitdeli-chef avatar chvanikoff avatar stvolodymyr avatar dvv avatar

Watchers

James Cloos avatar Hampus Bergström avatar

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.