FastJsonparser, Fastest JSON parser for Ruby

FastJsonparser is ruby wrapper for simdjson which is written in c++.

JSON is de facto standard for exchanging data between web server and browser.

If your application is parsing large JSON data then you must consider optimising it for better performance.

I came across Simdjson which claims to parse gigabytes of JSON per second, It also claims to be over 2.5x faster than other production-grade JSON parsers. I thought this is fantastic why I am not using it.

I looked for the ways to use it and came across simdjson_ruby gem . It is wrapper for simdjson c++ library but unfortunately it was not working.

I started fixing it but got stuck in configurations then I thought why not create a new gem and import all code which I need from this gem, thus FastJsonparser was born.

To verify simdjson claim that it is really fast, I did benchmarking with existing gem Oj which claims to be fastest JSON parser for Ruby

Benchmark results:

  1. Parsing 1.2 MB JSON file

Check benchmark reference here

2. Parsing local JSON

Check benchmark reference here

Clearly FastJsonparser outperforms both Oj and ruby’s built in JSON parser

How to Use FastJsonparser

Github: https://github.com/anilmaurya/fast_jsonparser

Let’s use it in your Ruby / Ruby on Rails projects and let me know how it performs.

P.S — Thank you https://github.com/saka1 for initial code.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.