-
Notifications
You must be signed in to change notification settings - Fork 45
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
draft: store seed refactor #657
base: tomasarrachea-stress-test
Are you sure you want to change the base?
draft: store seed refactor #657
Conversation
Do you know where the bottlenecks are? Taking a brief look at the code it seems like we are instantiating a lot of random number generators - these could be quite expensive (especially the RPO ones). So, I'd switch to lighter versions and also try to use the same instance as much as possible.
Something doesn't seem right here:
|
I didn't check how size is measured; but the write could be stuck in the WAL file still? |
I was checking only the size of Though I want to clarify that it is each 1000 batches, each block is 16 batches in the implementation so we keep track of the increase of size every 62.5 blocks.
The 7k are batches, so it is like ~440 blocks. We are using 255 accounts per block + 1 tx to mint assets to each one of the accounts.
I will come back with the results of this new run with 1M accounts and with the store size fixed. Currently it is taking like ~1 hour to run for 1M accounts (for the total process). |
here you can visualize a flamegraph for 1M accounts (removed the preview because it was too big): |
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. |
@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. But my numbers doesn't look that great.
I'm getting like 1.56 blocks/second. I'm now researching what can be the bottleneck.
Also, I have this info related to the store size:
This numbers are from running the binary for 100k accounts.