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

Slow wallet performance for large wallets #1082

Closed
urza opened this issue May 23, 2018 · 5 comments
Closed

Slow wallet performance for large wallets #1082

urza opened this issue May 23, 2018 · 5 comments

Comments

@urza
Copy link

urza commented May 23, 2018

When wallet.dat contains lot of outputs, some operations take very long.
From testing our mozkomor miner we have wallet.dat that is about 10 MB in size (cca 500 000 testnet grins)

For example
grin wallet info
takes cca 1 minute to output results on my 6 core machine.
(Running on release, latest master)

With new/empty wallet, the response is near instantaneous.

Another place where you can observe this effect is in stratum server. When miner finds valid block and submits it to stratum server, there is cca 30 seconds delay before stratum server sends new job. Again with new/empty wallet, this is near instantaneous. My guess is that grin node is synchronously saving the newly mined block coinbase before assembling new candidate block for mining...

Let me know if we can provide anything additional to help pin this down.

@yeastplume
Copy link
Member

Unfortunately, this is unlikely to be a particular issue with a single fix. Each wallet info command checks each and every output in the wallet against the server, and the server retrieves outputs one-by-one from the UTXO set, which involves several locks, a database lookup and a file seek and read. The process is very un-optimised, and speeding it up will need some profiling and tuning. Also, there's no good way to 'batch' retrievals from the underlying storage, each UTXO needs to be looked up and accessed individually.

@ignopeverell
Copy link
Contributor

We could prolly easily solve that for the stratum implementation at least, I don't think it needs to do a full wallet refresh.

@yeastplume
Copy link
Member

Yes, agreed. A round of performance enhancements on UTXO retrieval will be good for the overall wallet experience, though wouldn't expect we'll get a wallet with 8000 outputs to completely refresh itself in sub-second time. We may want some feature to get UTXO deltas from block to block to allow for partial wallet refreshes instead of having to refresh every output every time

@ignopeverell
Copy link
Contributor

I'll take a look, I'm around that code anyway (to do the cleanup of old unconfirmed).

@hashmap
Copy link
Contributor

hashmap commented Jan 24, 2019

Wallet performance has been sufficiently improved (or it just got hard to get a large wallet)

@hashmap hashmap closed this as completed Jan 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants