Skip to content

Conversation

@maflcko
Copy link
Member

@maflcko maflcko commented Jan 3, 2021

Seeing speedup here in the fuzz framework part (non-fuzz-target part). Speedup is only visible for input data larger than 100kB.

@DrahtBot
Copy link
Contributor

DrahtBot commented Jan 3, 2021

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

Reviewers, this pull request conflicts with the following ones:

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.

@practicalswift
Copy link
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? :)

@laanwj
Copy link
Member

laanwj commented Feb 1, 2021

Concept ACK , can be rebased and maybe opened for review now that #20464 is merged.

@maflcko maflcko marked this pull request as ready for review February 3, 2021 18:54
@maflcko
Copy link
Member Author

maflcko commented Feb 3, 2021

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

@maflcko
Copy link
Member Author

maflcko commented Feb 3, 2021

My result (N=10, Firefox was running in the background, so take with a span of salt):

out

@practicalswift
Copy link
Contributor

cr ACK faf7d74: patch looks correct :)

@laanwj
Copy link
Member

laanwj commented Feb 5, 2021

That chart is a work of art 😄

Code review ACK faf7d74

@laanwj laanwj merged commit 173cf31 into bitcoin:master Feb 5, 2021
@maflcko maflcko deleted the 2101-fuzzSpan branch February 5, 2021 15:40
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Feb 5, 2021
… Span<>

faf7d74 fuzz: Avoid extraneous copy of input data, using Span<> (MarcoFalke)

Pull request description:

  Seeing speedup here in the fuzz framework part (non-fuzz-target part). Speedup is only visible for input data larger than 100kB.

ACKs for top commit:
  practicalswift:
    cr ACK faf7d74: patch looks correct :)
  laanwj:
    Code review ACK faf7d74

Tree-SHA512: 41af7118846e0dfee237a6d5269a6c7cfbc775d7bd1cc2a85814cb60f6c2b37fe7fd35f1a788d4f08e6e0202c48b71054b67d2931160c445c79fc59e5347dadf
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Aug 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants