Skip to content

Set up criterion and impl std::error::Error for error types #197

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

friendlymatthew
Copy link
Member

@friendlymatthew friendlymatthew commented May 8, 2025

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(())
}

Copy link
Contributor

hyperlint-ai bot commented May 8, 2025

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::Error for 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.

Copy link

codecov bot commented May 8, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!

Copy link

codspeed-hq bot commented May 8, 2025

CodSpeed Performance Report

Merging #197 will not alter performance

Comparing criterion (6bdf427) with main (6ed1f88)

Summary

✅ 14 untouched benchmarks
⁉️ 56 dropped benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark BASE HEAD Change
⁉️ big_jiter_iter 36.5 ms N/A N/A
⁉️ big_jiter_skip 18.8 ms N/A N/A
⁉️ big_jiter_value 49.3 ms N/A N/A
⁉️ big_serde_value 201.8 ms N/A N/A
⁉️ bigints_array_jiter_iter 125.3 µs N/A N/A
⁉️ bigints_array_jiter_skip 93 µs N/A N/A
⁉️ bigints_array_jiter_value 210.2 µs N/A N/A
⁉️ bigints_array_serde_value 723.3 µs N/A N/A
⁉️ floats_array_jiter_iter 182.5 µs N/A N/A
⁉️ floats_array_jiter_skip 105 µs N/A N/A
⁉️ floats_array_jiter_value 307.2 µs N/A N/A
⁉️ floats_array_serde_value 1.1 ms N/A N/A
⁉️ massive_ints_array_jiter_iter 574.4 µs N/A N/A
⁉️ massive_ints_array_jiter_skip 222.3 µs N/A N/A
⁉️ massive_ints_array_jiter_value 768.7 µs N/A N/A
⁉️ massive_ints_array_serde_value 2.2 ms N/A N/A
⁉️ medium_response_jiter_skip 16.7 µs N/A N/A
⁉️ medium_response_jiter_value 38.1 µs N/A N/A
⁉️ medium_response_jiter_value_owned 50.6 µs N/A N/A
⁉️ medium_response_serde_value 87.4 µs N/A N/A
... ... ... ... ...

ℹ️ Only the first 20 benchmarks are displayed. Go to the app to view all benchmarks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant