8000 Benchmark BNF examples via Criterion by CrockAgile · Pull Request #91 · shnewto/bnf · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Benchmark BNF examples via Criterion #91

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

Merged
merged 2 commits into from
May 7, 2022
Merged

Conversation

CrockAgile
Copy link
Collaborator
@CrockAgile CrockAgile commented May 4, 2022

Changes

I hope the README explains this PR. But one additional nice thing to look at is a screenshot from the Criterion report 😍

image

Obviously big caveat to the numbers. Running on my personal laptop, with other process activity, etc. But nice to see what the reports can look like!

Issues

One potential issue with these benchmarks is that Grammar::generate relies on random seeds. Currently there is no public API for generating with a static, controlled seed for reliable benchmarking. This introduces some chance to that benchmark, but hopefully it is small noise in the big picture. On my machine, I observed ~2% of performance drift between random Grammar::generate benchmarks.

@CrockAgile CrockAgile self-assigned this May 4, 2022

fn examples(c: &mut Criterion) {
c.bench_function("parse postal", |b| {
let input = std::include_str!("../tests/fixtures/postal_address.terminated.input.bnf");
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

importing from the integration tests makes this a little brittle, but it seemed preferable to duplication

Copy link
Owner
@shnewto shnewto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍👍

@shnewto
Copy link
Owner
shnewto commented May 7, 2022

this is rad, really glad to see it incorporated, totally agree with 😍

@CrockAgile CrockAgile changed the base branch from edition-2021 to main May 7, 2022 15:21
@CrockAgile CrockAgile force-pushed the benchmarking-criterion branch from 1e24c4c to 3dd3171 Compare May 7, 2022 15:28
@codecov
Copy link
codecov bot commented May 7, 2022

Codecov Report

Merging #91 (3dd3171) into main (ae2f27c) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main      #91   +/-   ##
=======================================
  Coverage   91.94%   91.94%           
=======================================
  Files          10       10           
  Lines         869      869           
=======================================
  Hits          799      799           
  Misses         70       70           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ae2f27c...3dd3171. Read the comment docs.

@CrockAgile CrockAgile marked this pull request as ready for review May 7, 2022 15:32
@shnewto shnewto merged commit 37173d6 into main May 7, 2022
@shnewto shnewto deleted the benchmarking-criterion branch July 9, 2022 21:37
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.

2 participants
0