Skip to content
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

Re-organize and add iai-callgrind benchmarks #36

Merged
merged 8 commits into from
Sep 15, 2024
Merged

Re-organize and add iai-callgrind benchmarks #36

merged 8 commits into from
Sep 15, 2024

Conversation

declanvk
Copy link
Owner

No description provided.

**Description**
 - Remove `rustc_hash` dependency
 - Have the fixed length key generator return an array instead of a
   boxed slice

**Motivation**
 - Remove little-used dependency
 - Less memory usage by removing indirection of boxed slice, it shows
   up in the tests

**Testing Done**
`cargo test`
**Description**
Simplify the fixed-length key generator so it returns the expected
number of keys, and no longer spreads the digits over the entire
[0, 255] range.

**Motivation**
This fix was done so that I could generate similarly sized inputs for
the benchmarks.

**Testing Done**
`cargo test`
**Description**
 - Re-organize the criterion benchmarks into a nested structure with a
   single main entrypoint.
 - Convert a couple `debug_assert`s to `assert`s so that there is a
   consistent error message even in release mode

**Motivation**
I wanted to try and share benchmark definitions between criterion and
iai-callgrind, but that didn't really pan out. This change is
in-between and I like that there is only a single benchmark binary
instead of one per-group.

**Testing Done**
`./scripts/full-test.sh nightly`
**Description**
Add `iai-callgrind` benchmarks over the similar set of functions
currently benchmarked by criterion.

**Motivation**
I like the `iai-callgrind` benchmarks because they are very precise
and subsequent runs with no code change return mostly the same
result.

They also run fewer iterations than criterion, and generally take
less time to run. This makes it easier to run them as part of the
developing loop.

**Testing Done**
`./scripts/full-test.sh nightly`
@declanvk declanvk merged commit 808c38b into main Sep 15, 2024
4 checks passed
@declanvk declanvk deleted the fix-benches branch September 15, 2024 05:19
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