Skip to content
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

rusk-wallet: Rocksdb slowing this cli down #2511

Open
Daksh14 opened this issue Sep 28, 2023 · 5 comments
Open

rusk-wallet: Rocksdb slowing this cli down #2511

Daksh14 opened this issue Sep 28, 2023 · 5 comments
Assignees
Labels
fix:bug Something isn't working

Comments

@Daksh14
Copy link
Contributor

Daksh14 commented Sep 28, 2023

Flamegraph says:
We create column families for all 255 addresses everytime we initiate a cache database. That's not very efficient.

Second reason is that rocksdb works best when there's few column families only.

Currently we have 255. According to benchmark in the issue, that should take close to a minute to be done. That is super slow.

Find a way to reduce column families all together is one way to solve this problem.

We insert all 255 on every db init, a user might not use that many, we can only insert the cf(s) that are being used

@Daksh14 Daksh14 added the fix:bug Something isn't working label Sep 28, 2023
@Daksh14
Copy link
Contributor Author

Daksh14 commented Sep 29, 2023

Delete cache in /.dusk/rusk-wallet

And then run

CARGO_PROFILE_RELEASE_DEBUG=true sudo cargo flamegraph --bin rusk-wallet -- -n <network-your-on>

flamegraph

@herr-seppia
Copy link
Member

I disagree about this being a bug.

Furthermore the creation of the column families happens only when the cache database file is created, and not every time that it's instantiated

Does flamegraph report the same if you use the wallet with an existing cache? (Just to mimic the everyday usecase)

@Daksh14
Copy link
Contributor Author

Daksh14 commented Sep 30, 2023

@herr-seppia This is not a bug for sure.

The problem only happens when creating/deleting cf(s) which happens only when initiating the cache. If a user decides to change networks on the wallet which includes everyday use case, it will take quite a long time to do so.

Edit: This is wrong, we can just add a warning on first init that this process is gonna take a while

@herr-seppia
Copy link
Member

Edit: This is wrong, we can just add a warning on first init that this process is gonna take a while

@Daksh14 Do you believe that this hint would be enough to tackle this issue?

@Daksh14
Copy link
Contributor Author

Daksh14 commented Oct 23, 2023

Edit: This is wrong, we can just add a warning on first init that this process is gonna take a while

@Daksh14 Do you believe that this hint would be enough to tackle this issue?

Yes because after that last heights are updated and we fetch from there. So it won't be as overhead heavy as the first sync.

@HDauven HDauven changed the title Rocksdb slowing this cli down rusk-wallet: Rocksdb slowing this cli down Sep 28, 2024
@HDauven HDauven transferred this issue from dusk-network/wallet-cli Sep 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants