weichch / system-text-json-jsondiffpatch

High-performance, low-allocating JSON object diff and patch extension for System.Text.Json. Support generating patch document in RFC 6902 JSON Patch format.
MIT License
102 stars 13 forks source link

Improve benchmarks #7

Closed weichch closed 2 years ago

weichch commented 2 years ago

The benchmarks are confusing as it only compares JToken with JsonNode in readonly mode.

With when comparing JsonNode in readonly mode, we only have two options:

With RawText mode, it is not expected to output the same result as JToken comparison which is semantic only. Therefore, the benchmarks to compare those two are confusing.

With Semantic mode, it is expected the comparison of JsonNode to be slower than JToken comparison as the materialize processing can happen multiple times during comparison (currently a design to keep memory allocation low). This should ideally be evaluated so that we could refer to the result when improving in this area. We should also add benchmarks for comparing materialized JsonNodes, and compare the benchmark results with JToken comparison, so that it shows the algorithm level benchmarking results. This should not include JSON parsing.

The actions: