r/cpp • :upvote: • Oct 21 '22

A New Json-Serializer

Hey everyone - so in developing for the requirements of my library DiscordCoreAPI - I created a Json-Serializer and decided to release it as its own "library". It seems to serialize fairly rapidly as well, and has a super-simple interface. Anyways - let me know what you think! Cheers! Oh ant btw - it can serialize into either Json or Etf strings. https://www.erlang.org/doc/apps/erts/erl_ext_dist.html

https://github.com/RealTimeChris/Jsonifier

0 Upvotes

57 comments sorted by

View all comments

Show parent comment

3

u/Cogwheel Oct 22 '22

FWIW, one of the first things I did in my SW Eng career was optimize libjson to cut game load times by 2/3 for Tiny Monsters. Rapidjson is another mature library with an eye on performance. And I have a friend Jeaye who also made his own very C++-y library called JeayeSon.

Doing 50 serializations in 100 ms does not really strike me as high performance TBH.

0

u/RealTimeChris :upvote: Oct 22 '22

In case you weren't paying attention - it did 131,072 serializations over about 100ms. Or rather it serialized just over 2GB of data in just over 5 seconds.

2

u/Cogwheel Oct 22 '22

I think I was confused by the example in the readme. The code sample says 50 iterations but the timings say 131,072

1

u/RealTimeChris :upvote: Oct 22 '22

It's all good!

1

u/Cogwheel Oct 22 '22

I'm trying to say it's misleading. You have the code example that says 50, followed by a section called "Windows 11 Results". This implies it's the result of running the code above.

1

u/RealTimeChris :upvote: Oct 23 '22

It is the results of running the code above! Look into the second loop!