/json-hydrate-benchmark

Small hobby project to test the performance of Rust<->Python bindings for hydration in pgstac

Primary LanguagePythonApache License 2.0Apache-2.0

json-hydrate-benchmark

Small hobby project to test the performance of Rust<->Python bindings for "hydration" in pgstac.

Results

The "do it in Rust but operate on the Python object directly" approach is the fastest:

method time
python 43.2±2μs
serde_json 193±10μs
pyo3 7.89±0.2μs

Running benchmarks

You'll need Rust and Python 3.11. Then:

scripts/bench

Developing

pip install -e '.[dev]'

We've got some tests:

pytest