-
Notifications
You must be signed in to change notification settings - Fork 20
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
criterion: initial benchmarks #352
Draft
hinto-janai
wants to merge
48
commits into
Cuprate:main
Choose a base branch
from
hinto-janai:criterion
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
this `cfg()` existing makes a regular workspace `cargo b` fail
github-actions
bot
added
A-dependency
Related to dependencies, or changes to a Cargo.{toml,lock} file.
A-workspace
Changes to a root workspace file or general repo file.
A-docs
Related to documentation.
A-storage
Related to storage.
A-benches
Related to benchmarks.
labels
Nov 28, 2024
27 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-benches
Related to benchmarks.
A-dependency
Related to dependencies, or changes to a Cargo.{toml,lock} file.
A-docs
Related to documentation.
A-storage
Related to storage.
A-workspace
Changes to a root workspace file or general repo file.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What
Adds initial Criterion benchmarks for:
cuprate-helper
cuprate-database
cuprate-cryptonight
cuprate-rpc-types
cuprate-blockchain
The location of these is
benches/criterion/$CRATE
e.g.benches/criterion/cuprate-helper
.This PR combines #322 #324 #327 #328 #332 to prevent merge conflicts.
In-memory disk ops
cuprate-{database,blockchain}
are setup to usetempfile::tempdir()
which usesstd::env::temp_dir()
which should be in-memory (/tmp
) on most Linuxes, not sure about Windows/macOS. This should remove disk-related variables and provide more accurate function runtime data.When broader
benches/benchmark
s are created, those could use disk to provide more realistic real-world data.cuprate-helper
cuprate-database
code formatting
is faster21.809 ns
31.675 ns
21.696 ns
23.204 ns
4.6742 ns
33.221 ns
22.017 ns
1.9254 µs
3.2995 µs
286.33 ns
305.60 ns
65.183 ns
33.163 ns
cuprate-cryptonight
Benchmark naming scheme:
format!("{hash_fn_name}_{}", input.len())
E.g.
cuprate_cryptonight::cryptonight_hash_v0(&[0; 8])
isv0_8
.cuprate-rpc-types
cuprate-blockchain