Poison - an incredibly fast, pure Elixir JSON library

Poison, the extremely fast and standards compliant JSON library for Elixir:

Poison is a JSON library for Elixir focusing on wicked-fast speed without sacrificing simplicity, completeness, or correctness.

Poison takes several approaches to be the fastest JSON library for Elixir.

Poison uses extensive sub binary matching, a hand-rolled parser using several techniques that are known to benefit BeamAsm for JIT compilation, IO list encoding and single-pass decoding.

Poison benchmarks sometimes puts Poison’s performance close to jiffy and usually faster than other Erlang/Elixir libraries.

Poison fully conforms to RFC 8259, ECMA 404, and fully passes the JSONTestSuite.


v6.0.0 has just been released and packs a lot of new features, bug fixes and performance improvements over the previous release. It’s probably best to reference the CHANGELOG for more information.

Poison was already very performant in 5.0.0, but now Poison takes a sizable lead over other pure Elixir JSON libraries (namely Jason) when parsing and also on encoding workloads that include a lot of UTF-8 strings (both native and encoded).

Enjoy!

19 Likes

Awesome work on this and the benchmark, hopefully any future work in improving JSON can happen in OTP so the community don’t have to figure out which JSON library they have to use, FWIW I have the same reservations with mint and req, would be ideal if those lesson learned got upstream to OTP.

You have been an awesome contributor to our community and can’t wait to see more of your work having an even larger impact on the beam community as a whole!

7 Likes

hopefully any future work in improving JSON can happen in OTP

That hope is already a reality with OTP 27

1 Like

I too like the competition and am looking forward to all those lessons learned to be firmly inside OTP.

Please read my message again after you have read Poison’s source code.