-
Couldn't load subscription status.
- Fork 24
chore: Added helper to reduce code duplication between Db.propose and Proposal.create_proposal #1343
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
base: main
Are you sure you want to change the base?
Conversation
…s/firewood into bernard/insert-worker-pool-rayon
worker thread compiles (not tested).
a new branch node with an empty partial path is added to support parallel insertion. Appears to be working.
trie after the insert operations.
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.
Looks good, but please apply the comments before merging.
…pose' into bernard/combine-propose
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 start, but I think we can do a bit better, especially since this area is likely to change.
IMO the right way to fix this is to use a value set at database open time as the value of force_parallel. This is because I think we'll eventually need some way to mark parallel as always disabled.
IMO the best way to fix this is to create an enum with values NEVER, BATCH_SIZE(usize), ALWAYS set at database open time. That has the higest readability and would probably make this code change much cleaner.
I don't think we need both a force_parallel Option and an enum. I've instead added a enum field in Db, and set BatchSize (8 currently) as the default configuration value. Instead of checking for an option, it performs a match on an Enum during proposal creation. Please let me know if I've misunderstood your comment. |
Addresses #1342.
Created a
propose_with_parentto allow code reuse between Db.propose and Proposal.create_proposal.propose_with_parentwill also choose between using parallel or serial proposal creation based on the batch size. Currently the batch size for using parallel creation is 8, but there is a TODO to update the constant once we have some experimental results. We usesize_hint()on the batch iterator to estimate the batch size.