Set up criterion and impl `std::error::Error` for error types
This commit moves to criterion for its benchmarking suite. Also impls std::error::Error for jiter errors. Right now it fails to do:
use jiter::JsonValue;
// from the examples
fn main() -> Result<(), Box<dyn std::error::Error>> {
let json_data = r#"
{
"name": "John Doe",
"age": 43,
"phones": [
"+44 1234567",
"+44 2345678"
]
}"#;
let json_value = JsonValue::parse(json_data.as_bytes(), true)?; // <- can't do this right now.
println!("{:#?}", json_value);
Ok(())
}
PR Change Summary
Set up criterion for benchmarking and implemented std::error::Error for jiter errors.
- Migrated to criterion for the benchmarking suite
- Implemented
std::error::Errorfor jiter error types - Added a README for benchmark instructions
Added Files
-
crates/jiter/benches/README.md
How can I customize these reviews?
Check out the Hyperlint AI Reviewer docs for more information on how to customize the review.
If you just want to ignore it on this PR, you can add the hyperlint-ignore label to the PR. Future changes won't trigger a Hyperlint review.
Note specifically for link checks, we only check the first 30 links in a file and we cache the results for several hours (for instance, if you just added a page, you might experience this). Our recommendation is to add hyperlint-ignore to the PR to ignore the link check for this PR.
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
:loudspeaker: Thoughts on this report? Let us know!
CodSpeed Performance Report
Merging #197 will create unknown performance changes
Comparing criterion (a10651b) with main (961d830)
Summary
๐ 70 new benchmarks
โ๏ธ 70 dropped benchmarks
:warning: Please fix the performance issues or acknowledge them on CodSpeed.
Benchmarks breakdown
| Benchmark | BASE |
HEAD |
Change | |
|---|---|---|---|---|
| ๐ | big_jiter_iter |
N/A | 36.9 ms | N/A |
| ๐ | big_jiter_skip |
N/A | 19.2 ms | N/A |
| ๐ | big_jiter_value |
N/A | 49.9 ms | N/A |
| ๐ | big_serde_value |
N/A | 204.3 ms | N/A |
| ๐ | bigints_array_jiter_iter |
N/A | 125.3 ยตs | N/A |
| ๐ | bigints_array_jiter_skip |
N/A | 94.1 ยตs | N/A |
| ๐ | bigints_array_jiter_value |
N/A | 208.9 ยตs | N/A |
| ๐ | bigints_array_serde_value |
N/A | 719.3 ยตs | N/A |
| ๐ | floats_array_jiter_iter |
N/A | 184.7 ยตs | N/A |
| ๐ | floats_array_jiter_skip |
N/A | 106.2 ยตs | N/A |
| ๐ | floats_array_jiter_value |
N/A | 308.3 ยตs | N/A |
| ๐ | floats_array_serde_value |
N/A | 1.1 ms | N/A |
| ๐ | massive_ints_array_jiter_iter |
N/A | 573 ยตs | N/A |
| ๐ | massive_ints_array_jiter_skip |
N/A | 223.4 ยตs | N/A |
| ๐ | massive_ints_array_jiter_value |
N/A | 764.8 ยตs | N/A |
| ๐ | massive_ints_array_serde_value |
N/A | 2.2 ms | N/A |
| ๐ | medium_response_jiter_skip |
N/A | 16.9 ยตs | N/A |
| ๐ | medium_response_jiter_value |
N/A | 37.8 ยตs | N/A |
| ๐ | medium_response_jiter_value_owned |
N/A | 50.7 ยตs | N/A |
| ๐ | medium_response_serde_value |
N/A | 84.3 ยตs | N/A |
| ... | ... | ... | ... | ... |
:information_source: Only the first 20 benchmarks are displayed. Go to the app to view all benchmarks.
Looks like this introduces a dependency on half that is not MSRV compatible. It might be possible to tune things to make that not the case.