-
Notifications
You must be signed in to change notification settings - Fork 412
Replace std's unmaintained bench with criterion #2235
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
TheBlueMatt
merged 5 commits into
lightningdevkit:main
from
TheBlueMatt:2023-04-criterion
May 20, 2023
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
fbaa3c4
Unify route benchmarking with route tests
TheBlueMatt 2775902
Add an additional test/bench for routing larger amounts, score more
TheBlueMatt 1701b02
Replace std's unmaintained bench with criterion
TheBlueMatt 6ddc88b
Add trivial README to bench to describe how to run them.
TheBlueMatt 4b27cc4
Update .gitignore to ignore benchmark data files
TheBlueMatt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 file contains hidden or 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 file contains hidden or 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 file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
[package] | ||
name = "lightning-bench" | ||
version = "0.0.1" | ||
authors = ["Matt Corallo"] | ||
edition = "2018" | ||
|
||
[[bench]] | ||
name = "bench" | ||
harness = false | ||
|
||
[features] | ||
hashbrown = ["lightning/hashbrown"] | ||
|
||
[dependencies] | ||
lightning = { path = "../lightning", features = ["_test_utils", "criterion"] } | ||
lightning-persister = { path = "../lightning-persister", features = ["criterion"] } | ||
lightning-rapid-gossip-sync = { path = "../lightning-rapid-gossip-sync", features = ["criterion"] } | ||
criterion = { version = "0.4", default-features = false } | ||
|
||
[profile.release] | ||
opt-level = 3 | ||
codegen-units = 1 | ||
lto = true | ||
panic = "abort" | ||
debug = true |
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
This crate uses criterion to benchmark various LDK functions. | ||
|
||
It can be run as `RUSTFLAGS=--cfg=ldk_bench cargo bench`. | ||
|
||
For routing or other HashMap-bottlenecked functions, the `hashbrown` feature | ||
should also be benchmarked. |
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
extern crate lightning; | ||
extern crate lightning_persister; | ||
|
||
extern crate criterion; | ||
|
||
use criterion::{criterion_group, criterion_main}; | ||
|
||
criterion_group!(benches, | ||
// Note that benches run in the order given here. Thus, they're sorted according to how likely | ||
// developers are to be working on the specific code listed, then by runtime. | ||
lightning::routing::router::benches::generate_routes_with_zero_penalty_scorer, | ||
lightning::routing::router::benches::generate_mpp_routes_with_zero_penalty_scorer, | ||
lightning::routing::router::benches::generate_routes_with_probabilistic_scorer, | ||
lightning::routing::router::benches::generate_mpp_routes_with_probabilistic_scorer, | ||
lightning::routing::router::benches::generate_large_mpp_routes_with_probabilistic_scorer, | ||
lightning::sign::benches::bench_get_secure_random_bytes, | ||
lightning::ln::channelmanager::bench::bench_sends, | ||
lightning_persister::bench::bench_sends, | ||
lightning_rapid_gossip_sync::bench::bench_reading_full_graph_from_file, | ||
lightning::routing::gossip::benches::read_network_graph, | ||
lightning::routing::gossip::benches::write_network_graph); | ||
criterion_main!(benches); |
This file contains hidden or 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 file contains hidden or 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 file contains hidden or 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 file contains hidden or 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 file contains hidden or 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 file contains hidden or 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 file contains hidden or 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 file contains hidden or 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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.