ibireme / yyjson_benchmark

Benchmark JSON library performance in C/C++
MIT License
48 stars 9 forks source link

Add simdjson's benchmark tests #3

Open dan-ryan opened 1 year ago

dan-ryan commented 1 year ago

Simdjson's benchmark shows them to be the fastest. I suggest this benchmark project add their benchmark tests so it doesn't look like there is cherry-picking :) https://github.com/simdjson/simdjson#performance-results

ibireme commented 1 year ago

simdjson has two sets of APIs: DOM and on-demand. The DOM API is like most JSON parsers, the JSON string is parsed into a document, and then the user manipulates this document. The on-demand API is different, it is more like an iterator and doesn't provide a fully-parsed document. So the two cannot be compared directly.

As I said on the homepage of yyjson, the simdjson on-demand API is indeed faster if the user knows the order of keys at compile time. This project only measures the performance of the DOM API (like the previous tests of simdjson), new tests will be added when yyjson has a similar API in the future.

lano1106 commented 5 months ago

quick question... you have result for simdjson stringify...

I was wondering what you mean by stringify... I suppose it is to serialize a data structure into a JSON string... if that is what stringify means, I am confused since AFAIK, simdjson only deserialize....

ibireme commented 5 months ago

quick question... you have result for simdjson stringify...

I was wondering what you mean by stringify... I suppose it is to serialize a data structure into a JSON string... if that is what stringify means, I am confused since AFAIK, simdjson only deserialize....

simdjson can parse json data into immutable DOM, and then this DOM can be serialized into json using minify() function.