Lars Trieloff Lars Trieloff - 2 years ago 170
JSON Question

How to choose a Clojure JSON library

There are multiple JSON parser/writer libraries available for Clojure, including:

What are the pros and cons of each, especially regarding speed, memory footprint, and programming convenience? Are there any other important factors to consider?

Answer Source

I decided to run a little shootout (the link is to results and the code used to test).

In terms of speed, clj-json is the fastest, 1.7x cheshire, and 5.6x for a simple parse/generate task. has the smallest footprint, and clj-json and cheshire follow. cheshire has some superb features, though, and is my preferred library for dealing with JSON. You get support for SMILE, as well as a lovely interface for interpreting JSON (adding types, special rules on keys, etc) and custom encoders (the last also found in

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download