-
Notifications
You must be signed in to change notification settings - Fork 632
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
feat: Add benchmark for store
read/write
#5312
Conversation
8d5ca6a
to
15a0640
Compare
@matklad For some reason I'm only able to get back 48.5% of entries I put in the database. That seems wrong. |
@matklad |
https://crates.io/crates/tempfile is what we should use here. https://crates.io/crates/tempdir is indeed the old deprecated thing. |
@matklad I'm not sure this belongs to |
d3e5de2
to
76a6261
Compare
@mm-near I refactored the benchmark, can you take another look? |
@djsatok Figured out the reason. It turns out that, we set flags for this column for reference couting. That's the reason why not all columns get written to database. Thanks for looking into this. |
@matklad Ok, the benchmark is ready. |
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.
That's great!
Can we also make separate benchmark for ColState
writing values like this one, maybe in other PR?
I think ideally we need to check performance for each column with separately set options.
store
read/write
@mm-near Can you take a look? |
Good idea, we can do that in another PR. It should be easy to modify this code as an example. |
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.
What were the results of your benchmark? are they stable between runs?
@bowenwang1996 Please, take a look. |
c73643f
to
b005f33
Compare
b005f33
to
56ef270
Compare
Add benchmark for reading / writing from store. See #4771 ``` cd chain/network/benches rm -rf /tmp/xxxxx ; cargo bench benchmark_db ``` TODO: - [x] Add tempdir - [x] Pregenerate keys - [x] Add stats to see number of entries read successfully - [x] Why we can only read 48.5% entries back when we write them to DB? - [x] Move code to a better place - [x] Document what the benchmark does
Add benchmark for reading / writing from store.
See #4771
TODO: