Seeing speedup here in the fuzz framework part (non-fuzz-target part). Speedup is only visible for input data larger than 100kB.
fuzz: Avoid extraneous copy of input data, using Span<> #20839
pull MarcoFalke wants to merge 1 commits into bitcoin:master from MarcoFalke:2101-fuzzSpan changing 4 files +10 −11-
MarcoFalke commented at 4:30 PM on January 3, 2021: member
- DrahtBot added the label GUI on Jan 3, 2021
- DrahtBot added the label RPC/REST/ZMQ on Jan 3, 2021
- DrahtBot added the label UTXO Db and Indexes on Jan 3, 2021
- DrahtBot added the label Wallet on Jan 3, 2021
-
DrahtBot commented at 6:40 PM on January 3, 2021: member
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--174a7506f384e20aa4161008e828411d-->
Conflicts
Reviewers, this pull request conflicts with the following ones:
- #20663 (fuzz: Hide script_assets_test_minimizer by MarcoFalke)
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
- MarcoFalke removed the label GUI on Jan 3, 2021
- MarcoFalke removed the label RPC/REST/ZMQ on Jan 3, 2021
- MarcoFalke removed the label UTXO Db and Indexes on Jan 3, 2021
- MarcoFalke removed the label Wallet on Jan 3, 2021
- MarcoFalke added the label Tests on Jan 3, 2021
-
practicalswift commented at 9:09 PM on January 12, 2021: contributor
Seeing 5% speedup here in the fuzz framework part (non-fuzz-target part)
Nice! Can you share the benchmarks and/or details on how to reproduce? :)
-
fuzz: Avoid extraneous copy of input data, using Span<> faf7d7418c
- MarcoFalke force-pushed on Feb 3, 2021
- MarcoFalke marked this as ready for review on Feb 3, 2021
-
MarcoFalke commented at 6:57 PM on February 3, 2021: member
To reproduce:
diff --git a/src/test/fuzz/string.cpp b/src/test/fuzz/string.cpp index 282a2cd8ca..7a1c7b00d6 100644 --- a/src/test/fuzz/string.cpp +++ b/src/test/fuzz/string.cpp @@ -33,6 +33,16 @@ #include <string> #include <vector> +FUZZ_TARGET(max_throughput) +{ + FuzzedDataProvider fuzzed_data_provider(buffer.data(), buffer.size()); + assert( + // "Teach" libFuzzer to explore long sequences (needs -use_value_profile=1 -len_control=1 -max_len=2000000) + fuzzed_data_provider.remaining_bytes() < 500'000 || + // Make it crash when done + fuzzed_data_provider.ConsumeBool()); +} + FUZZ_TARGET(string) { FuzzedDataProvider fuzzed_data_provider(buffer.data(), buffer.size());Then run a bunch and plot all
(lim, exec/s).FUZZ=max_throughput ./src/test/fuzz/fuzz -use_value_profile=1 -len_control=1 -max_len=2000000 -
MarcoFalke commented at 7:20 PM on February 3, 2021: member
My result (N=10, Firefox was running in the background, so take with a span of salt):

-
practicalswift commented at 9:07 PM on February 4, 2021: contributor
cr ACK faf7d7418cf01cb04cd457bcc630654da958a777: patch looks correct :)
-
laanwj commented at 1:56 PM on February 5, 2021: member
That chart is a work of art :smile:
Code review ACK faf7d7418cf01cb04cd457bcc630654da958a777
- laanwj merged this on Feb 5, 2021
- laanwj closed this on Feb 5, 2021
- MarcoFalke deleted the branch on Feb 5, 2021
- sidhujag referenced this in commit 8d5ae0a11e on Feb 5, 2021
- DrahtBot locked this on Aug 16, 2022