Jump to content
Sign in to follow this  
pyscripter

JSON benchmarks

Recommended Posts

hydrobyte/TestJSON: A simple project to test JSON libraries with Delphi and C++Builder. presents JSON library benchmarks comparing a large number of alternatives.

 

One thing that strikes me, is that the System.JSON rtl library is doing relatively well compared to the competition, both in terms of performance and in terms of JSON validation.   With the exception of Find, is very competitive in all other areas.

 

I have seen many claims that System.JSON is very slow and that the xyz library is so many times faster.   Do these benchmarks suck (like most benchmarks)?   Or is it the case that System.JSON is not that bad?  What is your experience?

  • Like 4
  • Thanks 1

Share this post


Link to post
13 hours ago, pyscripter said:

hydrobyte/TestJSON: A simple project to test JSON libraries with Delphi and C++Builder. presents JSON library benchmarks comparing a large number of alternatives.

Way cool! 

Is there test/comparison is Objects and/or Record serialization supported and speed etc?? Did not check code, because bit busy...

I've used Grijjy in one of my hobby projects for serializing objects and/or records. Can't remember which they all are, poossibly both)

Edited by Tommi Prami

Share this post


Link to post
1 hour ago, Tommi Prami said:

Is there test/comparison is Objects and/or Record serialization supported and speed etc??

No. Most of the alternatives do not support serialization.  Grizzy and Superobject do.   Delphi offers a couple of ways.   But serialization is not  necessarily dependent on JSON parsing.   For example NEON is using System.JSON.   

Edited by pyscripter
  • Like 1

Share this post


Link to post

The tests ignore some subtle differences in the implementations. While some implementations ensure that you don't create multiple pairs with the same name the System.JSON AddPair method simply ignores that.

 

You can test that by adding a fLib.Add(SKey, SVal); after the loop in TTestSpeedRun.DoSubTestGen - some libraries will report 50000 items, while some report 50001 - System.JSON for example.

The fact that JDO uses a linear search here is a bit disappointing and the reason it completely falls off the cliff on the generate test.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×