-
Notifications
You must be signed in to change notification settings - Fork 158
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
More efficient QC.shuffle in transaction generator #1929
Conversation
pure (applyDelta neededKeys neededScripts keySpace tx delta) | ||
|
||
-- ====================================================== | ||
|
||
-- | Return up to /k/ random elements from /items/ | ||
-- (instead of the less efficient /take k <$> QC.shuffle items/) | ||
ruffle :: Int -> [a] -> Gen [a] |
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.
great word 😄
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.
LGTM!
@uroboros Great! We've been wanting this in consensus for a while now. Do you have measurements of how much faster this is than the previous version? |
@mrBliss I was using Tim's genTx benchmark as reference, which looks very promising! (The change was noticeable in the property test times too, but much less pronounced) BEFORE ------------------------------- benchmarking gen/genTx/1000 AFTER ------------------------------- benchmarking gen/genTx/1000 |
would be interesting to see how it plays out in consensus tests |
So a 2x speed-up. At the moment we have disabled the generator in the consensus because it was prohibitively slow, but also because it triggered a failing assertion in the network layer (that the network team isn't going to fix soon). The latter means that we can't turn it back on again 🙁. However, we also use this generator (in)directly, when generating random blocks and transactions for our serialisation roundtrip tests, which are rather slow at the moment. If these get 2x faster, that would also be nice. I'll report back when I have results (this will take a while, as I still have to propagate a bunch of changes). |
2702: Update dependencies r=mrBliss a=mrBliss Highlights: * IntersectMBO/cardano-ledger#1915 * IntersectMBO/cardano-ledger#1922 * IntersectMBO/cardano-ledger#1902 * IntersectMBO/cardano-ledger#1923 * IntersectMBO/cardano-ledger#1927 * IntersectMBO/cardano-ledger#1929 Co-authored-by: Thomas Winant <thomas@well-typed.com>
Resolves JIRA issue CAD-2062
The transaction generator was "QuickCheck shuffling" potentially large lists - these shuffles have been replaced by more efficient ruffles.