-
Notifications
You must be signed in to change notification settings - Fork 36.2k
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
bench: Add --sanity-check
flag, use it in make check
#25107
Conversation
Concept ACK |
Concept ACK |
c9de493
to
63068c7
Compare
Concept ACK |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Concept and approach ACK, now building and testing.
63068c7
to
c52a71e
Compare
Re-pushed to address @jonatack's comments. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested ACK c52a71e though the reduction in run time isn't large in my testing
OK
Running bench/bench_bitcoin (one iteration sanity check)...
bench/bench_bitcoin --one-iteration > /dev/null
Modulo typo in first commit message s/kebab-hase/kebab-case/
Looks like #24924 might be related |
c52a71e
to
48b3828
Compare
Re-pushed:
Should be ready for final review round and merge. |
--one-iteration
flag, use it in make check
--sanity-check
flag, use it in make check
The benchmarks are run as part of `make check` for a minimum sanity check. The actual results are being ignored. So only run them for one iteration. This makes the `bench_bitcoin` part take 2m00 instead of 5m20 here. Which is still too long (imo), but this needs to be solved in the `WalletLoading*` benchmarks which take that long per iteration.
This is customary for UNIX-style arguments, and more consistent with our other tools
48b3828
to
4f31c21
Compare
Concept ACK. |
@@ -57,6 +57,10 @@ void benchmark::BenchRunner::RunAll(const Args& args) | |||
std::regex reFilter(args.regex_filter); | |||
std::smatch baseMatch; | |||
|
|||
if (args.sanity_check) { | |||
std::cout << "Running with --sanity check option, benchmark results will be useless." << std::endl; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
std::cout << "Running with --sanity check option, benchmark results will be useless." << std::endl; | |
std::cout << "Running with -sanity-check option, benchmark results will be useless." << std::endl; |
Also s/--sanity-check/-sanity-check/ in the commit message?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure as there isn't a single-letter option like -s here, but per https://www.gnu.org/software/libc/manual/html_node/Argument-Syntax.html: "Long options consist of -- followed by a name made of alphanumeric characters and dashes. Option names are typically one to three words long, with hyphens to separate words. Users can abbreviate the option names as long as the abbreviations are unique."
Edit: never mind, our convention is to use a single-hyphen prefix. That said, either way works for documentation purposes.
@echo "Running bench/bench_bitcoin ..." | ||
$(BENCH_BINARY) > /dev/null | ||
@echo "Running bench/bench_bitcoin (one iteration sanity check)..." | ||
$(BENCH_BINARY) --sanity-check > /dev/null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$(BENCH_BINARY) --sanity-check > /dev/null | |
$(BENCH_BINARY) -sanity-check > /dev/null |
ACK 4f31c21 on the sanity-check version per |
@hebasto Maybe I'm an old UNIX fart in some things but I prefer long options prefixed with two |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 4f31c21, tested on Ubuntu 22.04.
…k` in "Win64 native" task 91bee4d ci: Run `bench_bitcoin.exe --sanity-check` in "Win64 native" task (Hennadii Stepanov) Pull request description: This PR adds [`--sanity-check`](bitcoin/bitcoin#25107) flag to `src\bench_bitcoin.exe` invocation as its results are been discarded. Also a better name used for the script as it follows GNU's `make check`. ACKs for top commit: fanquake: ACK 91bee4d Tree-SHA512: fd5feeda72d1ef46c5fbfc2aa5c042ab2e3de7772546379da4596306b5658ab95f62939fba237c0bd7a1b09c85de20fc1cd9e5df1efe11bdae50d4a7b8081f74
The benchmarks are run as part of
make check
for a crash-sanity check. The actual results are being ignored. So only run them for one iteration.This makes the
bench_bitcoin
part take 2m00 instead of 5m20 here. Which is still too long (imo), but this needs to be solved in theWalletLoading*
benchmarks which take that long per iteration.Also change all
bench_bitcoin
arguments to kebab-case to be consistent with the other tools (in a separate commit).