Make trie-cache resettable from backend#14516
Conversation
bkchr
left a comment
There was a problem hiding this comment.
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 <git@kchr.de>
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. |
bkchr
left a comment
There was a problem hiding this comment.
Yeah, let's do it this way.
Not ultra great, but I also don't see any better way for now.
|
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 <git@kchr.de> --------- Co-authored-by: Bastian Köcher <git@kchr.de>
* Add ability to reset trie-cache * comment * Update client/db/src/lib.rs Co-authored-by: Bastian Köcher <git@kchr.de> --------- Co-authored-by: Bastian Köcher <git@kchr.de>
I have some benchmarks in cumulus where I want to reset the trie cache in between runs.