-
Notifications
You must be signed in to change notification settings - Fork 47
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: store seed command in stress test CLI #657
base: next
Are you sure you want to change the base?
Conversation
I added a couple more of metrics, and re run a couple times with different number of accounts. I'm consistently getting 4550~ish bytes/account |
It is worth mention that this number is the result of doing I ran the following query in the DB and got this results: SELECT
name,
SUM(pgsize) AS size_bytes,
(SUM(pgsize) * 1.0) / (SELECT COUNT(*) FROM accounts) AS bytes_per_row
FROM dbstat
WHERE name = 'accounts'; And got this results: |
4.5KB is better than 5MB - but still looks pretty high. Part of this is nullifiers and notes - but I don't see how these contribute more than 1KB (about 40 bytes for nullifiers + 80 bytes for notes + 500 bytes for note authentication paths). But it is also possible I'm missing something. Another possibility is that SQLite doesn't do compaction, and maybe there is a lot of "slack" in the file. |
There's also the overhead of block headers and indices as well, but those are also probably too small to consider. |
I added some queries to check the size of each table, and the avg size of each entry in every table. This is the current output of the binary:
|
58cac73
to
348b54c
Compare
I could not reduce the time that takes for each block. It is currently at 1.6 blocks/sec |
Do you have the breakdown of different components of this? Specifically, how much, out of 1.6 seconds is taken up by block construction vs. block insertion? |
Interesting! It seems like 97% of the database is in the |
@bobbinth I created #662 to address the notes issue.
According to the flamegraph, a big part of this process is in |
Looking at the code, I think what we are measuring as insertion time is actually What may make sense to do is build blocks manually (and probably the same for batches as well), without using block and batch builders. This is somewhat difficult now, but should become much easier after #659 and subsequent work is done. So, I guess we have 3 paths forward:
Assuming this is pretty close to being done, path 1 probably makes the most sense - but let me know what you think. |
@@ -15,35 +15,37 @@ version.workspace = true | |||
workspace = true | |||
|
|||
[features] | |||
testing = ["dep:miden-air", "dep:miden-node-test-macro", "dep:rand_chacha", "dep:winterfell"] |
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.
With a more manual approach to batch/block building, we probably wouldn't need to introduce the testing
feature. So, maybe that's an argument for putting the work on hold for now.
@bobbinth I think that 1) and 3) are the best options. In a way I think that having this command anyways, building blocks like it is currently doing, is fine for now. We are not testing block insertion time but we accomplish the goal of seeding the DB to further benchmark the endpoints. I agree with about 3) though, I don't really like re-introducing the |
Let's go with option (3) for now so that we don't have to introduce and then again remove the |
Ok, sounds good! I will put this and the StateSync benchmark one as drafts then. |
Updated this PR to use the new |
@bobbinth i'm applying your suggestion of a new structure (your comment here). The only thing I changed is that I create all the accounts before hand.
I added some queries to check the size of each table, and the avg size of each entry in every table. This is the current output of the binary:
For example, this is the current output for 100k accounts:
This PR was built on top of #621 .