-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Make trie-cache resettable from backend #14516
Conversation
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.
In general, can you not just recreate the backend? As we do in the Substrate based benchmarks. Then you don't need this function.
Co-authored-by: Bastian Köcher <[email protected]>
You mean like here? substrate/client/db/benches/state_access.rs Line 212 in da604f1
The substrate benchmarks reset the backend once for each benchmark. For my purposes I want to reset per iteration, so I would need to create a whole new client (not only backend) for each iteration. Being able to reset the trie cache seemed like the more elegant option here. But if you prefer I can look into that. |
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.
Yeah, let's do it this way.
Not ultra great, but I also don't see any better way for now.
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.
👍
bot merge |
Waiting for commit status. |
Merge cancelled due to error. Error: Statuses failed for efaeb51 |
* Add ability to reset trie-cache * comment * Update client/db/src/lib.rs Co-authored-by: Bastian Köcher <[email protected]> --------- Co-authored-by: Bastian Köcher <[email protected]>
* Add ability to reset trie-cache * comment * Update client/db/src/lib.rs Co-authored-by: Bastian Köcher <[email protected]> --------- Co-authored-by: Bastian Köcher <[email protected]>
I have some benchmarks in cumulus where I want to reset the trie cache in between runs.