[Smtk-developers] JSON in SMTK

Haocheng Liu haocheng.liu at kitware.com
Tue Sep 12 09:49:27 EDT 2017


On Mon, Sep 11, 2017 at 6:24 PM, David Thompson <david.thompson at kitware.com>
wrote:

> > It seems that we are using a C - library for JSON processing - has
> anyone looked at C++ 11 libs like:
> > https://github.com/nlohmann/json
>
> It looks nice. I would like to kick the tires a little, but it looks good
> enough to replace cJSON if it doesn't have any fatal flaws.
>
> @Ben jsoncpp is really terrible:
> + it is not concise to use (I'm not sure nlohmann is either because it
> lives in the "nlohmann" namespace);
> + it is slow -- see https://github.com/miloyip/
> nativejson-benchmark#parsing-time where cJSON takes 25ms and jsoncpp
> takes 166ms; nlohmann takes 71 ms which is not great but look at how easy
> it is to use; and
> + it is heavy (243k-LOC vs 42k for nlohmann and 27k for cJSON)
>
> We should help move CMake/VTK away from jsoncpp instead of designing
> software by seniority.
>
While browsing, I come across this data serization format as protobuf
<https://github.com/google/protobuf> developed by Google. It's four
times faster
than JSON and using much less space
<https://google.github.io/flatbuffers/flatbuffers_benchmarks.html>.  Is
there any reason why we stick to JSON or can we move to a better data
format?

        David
> _______________________________________________
> Smtk-developers mailing list
> Smtk-developers at smtk.org
> http://public.kitware.com/mailman/listinfo/smtk-developers
>



-- 
Best regards
Haocheng

Haocheng LIU
Kitware, Inc.
R&D Engineer
21 Corporate Drive
Clifton Park, NY 12065-8662
Phone: 518-881-4421 <(518)%20881-4421>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/smtk-developers/attachments/20170912/db616196/attachment-0001.html>


More information about the Smtk-developers mailing list