amazon-ion / ion-python

A Python implementation of Amazon Ion.
https://amazon-ion.github.io/ion-docs/
Apache License 2.0
260 stars 51 forks source link

Adds orjson into Ion python benchmark cli #253

Open cheqianh opened 1 year ago

cheqianh commented 1 year ago

Currently, orjson is removed from ion-python-benchmark-cli due to pypy incompatible. Need to add it back later.

popematt commented 1 year ago

Is orjson notably better that other json implementations in some way? I don't think we need to support every possible json implementation, so unless this one is notable somehow, I suggest we just leave it out.

cheqianh commented 1 year ago

We considered incorporating orjson into the benchmark-cli back then is because (1) It's the fastest library for most of the use case and (2) it's a Rust-Python binding library while other libraries are using C/C++.

However, the reasons we are not using it as the primary baseline are:

  1. orjson is relatively new, which as a result, has fewer users (but it doesn't mean that it's not good)
  2. orjson generates bytes, while other JSON libraries generate str. This indicates that orjson is not a drop-in replacement for most applications as they typically use str.
  3. orjson uses Rust-binding, which provides a significant performance boost. However, it requires further investigation whether the performance improvement is due to the library’s algorithm or the programming language Rust.

Agreed that we can just leave it unless there are specific comparisons needed such as Rust-binding implementation vs. CPython implementation.