stariy95 opened a new pull request #443: URL: https://github.com/apache/cayenne/pull/443
This PR contains a simple JSON parser that could be used to normalize and compare JSON values to exclude time-consuming SQL updates caused by different formatting of JSON strings. JSON parser is not intended for any other use-cases except for fast values comparison. Here are simple benchmark results comparing Cayenne's specialized implementation with some widely used libraries. Compare call in all cases is basically parsing two values + equals() call. ``` Benchmark Mode Cnt Score Error Units GsonBenchmark.compare avgt 12 89.533 ± 1.483 us/op GsonBenchmark.read avgt 12 39.398 ± 0.271 us/op JacksonBenchmark.compare avgt 12 80.887 ± 0.358 us/op JacksonBenchmark.read avgt 12 38.201 ± 0.347 us/op JsonTokenizerBenchmark.compare avgt 12 79.381 ± 0.722 us/op JsonTokenizerBenchmark.read avgt 12 20.126 ± 0.114 us/op JsonTokenizerBenchmark.normalize avgt 12 38.148 ± 0.554 us/op ``` ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org