coby

coby

Hi Everyone!

First time writer, long time reader here.

I’ve been using Elixir for the past two years or so, and I’ve noticed that every single JSON library has it’s own benchmarks, that all say that they are the best. I wanted to know which one was the fastest currently, so I decided to build my own benchmarks. I’d love inputs from everyone to see what people think!

To see the benchmarks, you can look here, under the outputs folder: Elixir Random Benchmarks

That repo also contains various benchmarks of Elixir core that I’ve used to find the fastest versions of different functionalities in the core Elixir language.

Showing Posts 1 to 10

dimitarvp

dimitarvp

As far as I’m aware, using Jason is the conventional wisdom in the Elixir circles for a while now.

keathley

keathley

In most benchmarks Jiffy tends to be the fastest of the well known libraries. Jason is slower but has more use throughout the community and its pure elixir. We use a combination of jiffy and jason at work and benchmark against our specific payloads.

coby

coby OP

That’s what I ended up seeing in the benchmarks.

One of my side projects right now is building a web server that can get faster performance than cowboy (I know, it’s a pipe dream). Part of that was choosing the fastest JSON parser, and when I went exploring the popular libraries, I saw that in every benchmark there were wildly different results, each favoring whichever library I was looking at, so I made my own little benchmark to see which was the fastest.

coby

coby OP

I know that Jason is the current standard, I use it when I use Plug or Phoenix, it’s one of my favorite libraries.

This was just a quick side project of mine to get a more definitive benchmark, since every library typically advertises the benchmarks that show their library to be the best, and I wanted to know which one was without any bias.

dtip

dtip

I’m curious - why is Jason the standard choice when jiffy has been around for ages (i.e. it’s stable and well-tested) and is much faster?

dimitarvp

dimitarvp

I can’t speak for @michalmuskala (the creator) but IMO the selling point is that it’s pure Elixir and has no native dependency. And that it’s stricter.

Especially if you deploy to various Docker and VPS configurations this can be a life saver since some VMs and hosting providers can be finicky when compiling native code. Not having to deal with various GCC / clang versions and distro-specific patches can make a huge difference.

keathley

keathley

Getting jiffy to compile isn’t hard. Shimming it into all of the existing libraries is more challenging.

dimitarvp

dimitarvp

Agreed, I am not saying it’s always hard, I am only saying that not using it gets you rid of one more potential deployment problem that will bite you just at the right night at 2:00 AM.

As a guy who usually works without devops and sysadmins around, I appreciate this a lot. Other people’s workflows vary of course.

coby

coby OP

It’s the same question I had, especially after my benchmarks. Jiffy has such a massive performance boost here that it just makes sense to use it. And it’s not like it’s an unknown library, it’s been established for a while as THE library in Erlang.

For my own uses I simply wrote a little Elixir wrapper around Jiffy so that I can make it look more Elixir-y, and still use Jiffy. It makes it a little easier to use Jiffy, which at the end of the day really isn’t that difficult.

coby

coby OP

Out of curiosity, what kind of deployments have you done where libraries that use NIFs are problematic?

My company has a few Elixir services in production, and they use some Erlang libraries and some NIFs as well, and we’ve never had any issues in deployments using Docker.

I feel like this might come off as mean, and I want to stress that I am not trying to be mean, this is genuine curiosity because I want to know if I might run into these issues in the future.

Where Next? Top

Trending in Discussions Top

AstonJ
The obligatory hello world thread! Who are you and where are you from? :stuck_out_tongue:
4663 61218 595
New
cblavier
Hey there, It’s been more than a year since we started using LiveView as our main UI library and building a whole library of UI componen...
515 12931 101
New
wmnnd
Hey folks, I wanted to share with you a project I’ve been working on for a while: It’s an Open Source (AGPLv3) newsletter tool. Think Ma...
New
raa-ziq
Hi everyone :waving_hand: I wanted to share something I’ve been building — NowBlind, a random chat app designed to help people discover ...
New
sntran
In my third year of college, around 2010, I found Erlang. A few years later, I found Elixir. I liked the ideas at once: many small proces...
New
Ganna
Hi everyone, I have 8 years of production experience with Erlang/OTP and I’m just starting to get to know Elixir. What would you learn f...
New
gtcode
I’ve been tinkering with Lynx (by José) via hold_ledger. I used AI to write the code, a separate specification, the tests, and the Lean p...
New

Other Trending Topics Top

dominicletz
Hey there, I haven’t seen a list of useful Elixir specific skills for the popular AI tools yet so I’m starting one here with my first. ...
New
mudasobwa
I fully migrated to my own harness from Anthropic/Gemini and I think it’s time to share it. Welcome DSH, the DeepSeek Harness, fully writ...
New
KristerV
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
OndrejValenta
(I just needed to vent somewhere and LinkedIn is full of hope, or hype, I’m not sure which exactly) AI dream has many faces, but general...
New
kip
Localize is the next generation localisation library for Elixir. Think of it as ex_cldr version 3.0. The first version will be released ...
New
webofbits
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself. My main conc...
#ai
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews