Shrinker performance benchmark#177
Merged
Merged
Conversation
This was referenced Apr 3, 2022
Closed
1bf5c8a to
230eb76
Compare
Collaborator
Author
|
I have rebased this benchmark PR on top of the merged test PRs. We still have a few tests printing to stdout, so to avoid garbling the two outputs I changed the program to write the results to a file - for now just hard-coded to For your viewing pleasure, below follows the output from a fresh run. The situation is (unsurprisingly) the same as I described above in the fall - but PRs #235 and #240 start to change that: |
This was referenced May 1, 2023
Merged
Merged
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR adds a shrinker benchmark.
It iterates the (factored) shrinker tests in QCheck_tests.ml and QCheck2_tests.ml in pairs.
For each such pair of tests we measure
Q1/sandQ2/s#succ#attThis is iterated across several seeds to make sure observations hold across more than one random run.
Finally we add up the timings to spot general trends.
Overall, the benchmark gives a reasonable idea of the state of affairs (see output below):
lists shorter than 4332fold_left fold_right uncurriedin one iteration, whereas QCheck spends 28.631 secs on only 125 successful shrink attempts out of 27750 onfold_left test, fun firstin another iteration.The benchmark starts to drill the framework:
I've therefore drafted (QCheck) performance improvements that will make such hacks unnecessary. I'll commit them separately.