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

ord wallet balance is extremely slow #3061

Closed
lifofifoX opened this issue Jan 28, 2024 · 6 comments · Fixed by #3142
Closed

ord wallet balance is extremely slow #3061

lifofifoX opened this issue Jan 28, 2024 · 6 comments · Fixed by #3142
Assignees
Labels

Comments

@lifofifoX
Copy link
Collaborator

Before:

$ time ./target/release/ord wallet balance
{
  "cardinal": 7315125,
  "ordinal": 676452,
  "total": 7991577
}

real    0m0.286s
user    0m0.019s
sys     0m0.033s

After:

$ time ./target/release/ord wallet --server-url http://0.0.0.0:4200 balance
{
  "cardinal": 7315125,
  "ordinal": 676452,
  "total": 7991577
}

real    0m23.050s
user    0m1.075s
sys     0m0.646s
@raphjaph
Copy link
Collaborator

raphjaph commented Jan 28, 2024

I expected the new wallet to be a bit slower since it gets it's info over RPC but that seems way too slow.

Can you try running with ord wallet --server-url http://0.0.0.0:4200 --no-sync balance?

Also which version is the ord server that runs in the background?

I could add async or multithreading to the wallet but didn't do that because that seems like overkill.

@lifofifoX
Copy link
Collaborator Author

@raphjaph Server is running the latest master 13c0fa1. Same time with --no-sync as well.

@raphjaph
Copy link
Collaborator

raphjaph commented Jan 29, 2024

I assume it's a pretty large wallet with many inscriptions?

I just ran it on my mainnet wallet with around 100 inscriptions and it went fast.

@lifofifoX
Copy link
Collaborator Author

@raphjaph Yup, almost 1k inscriptions.

@raphjaph
Copy link
Collaborator

raphjaph commented Feb 2, 2024

Before the next release I'll have to work on the wallet performance. I know I'm making a lot of redundant calls.

@raphjaph raphjaph added the bug label Feb 2, 2024
@raphjaph raphjaph added this to Tracker Feb 2, 2024
@raphjaph raphjaph moved this to To Do in Tracker Feb 2, 2024
@raphjaph raphjaph self-assigned this Feb 2, 2024
@casey casey removed the status in Tracker Feb 12, 2024
@casey casey moved this to To Do in Tracker Feb 12, 2024
@casey casey removed the status in Tracker Feb 12, 2024
@raphjaph raphjaph moved this to To Do in Tracker Feb 13, 2024
@gmart7t2
Copy link
Contributor

I made a new wallet and sent just 6 cardinals to it.

Running "ord wallet cardinals" takes 6.2 seconds to return those 6 cardinals. The /output/ endpoint is hit 18 times, 3 for each utxo in the wallet.

This is on regtest on my local machine.

This:

for output in utxos.keys() {
  self.get_output(output)?;
}

at the end of

  pub(crate) fn get_unspent_outputs(&self) -> Result<BTreeMap<OutPoint, TxOut>> {

is responsible for 2/3rds of the calls.

@raphjaph raphjaph moved this from To Do to In Progress in Tracker Feb 18, 2024
@raphjaph raphjaph moved this from In Progress to Ready for Review in Tracker Feb 19, 2024
@casey casey removed this from Tracker Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants