Update the actual benchmark harnesses.
Because the internal APIs previously used are no longer available, I
opted to use `compile` and `exec` from within the CPython context to
compile and execute code. There's probably more overhead to that than
the internal API had, but that overhead should be consistent per
benchmark.
If anyone cares about hyperoptimizing benchmarks then they can optimize
the harness as well.
The benchmarks have been broken since Python 3.10 deprecated the API
they were using to parse and execute CPython baselines. Since then
rust-cpython has been deprecated in favor of pyo3.
- Replace `cpython` and `python3-sys` with `pyo3`.
- Add `html_report` feature to `criterion`, it will be required in a
future release.
- Remove `anyhow`. It was unused and cargo cleaned it up automatically.
When building the project for the Miri CI step, the latest nightly
version apparently conflicts with the older `ahash` 0.8.3. Updating to
0.8.7 fixed the build for me locally.
The [docs](https://docs.python.org/3/library/functions.html#round)
specify that calling `round` with a negative precision removes
significant digits, so that `round(12345, -2) == 12300`. The
implementation was simply returning the original integer.
Additionally, `round(a, b)` is implemented as `(a / 10^b) * 10^b`, using
half-even rounding during the division.
In cpython, they use `_PyTime_ROUND_FLOOR` to read time.
But in RustPython, we use `[Duration::from_secs_f64](https://doc.rust-lang.org/std/time/struct.Duration.html#method.try_from_secs_f64)` to read time.
Therefore, RustPython isn't affected by the rounding issue in the way
that cpython does. We can safely ignore the `0.5*1e-9` bit in
`ns_to_sec` function.