Skip to content

Conversation

@pedrobranco
Copy link
Contributor

Trivial performance improvement.

It consists in preventing multiple calls to ExtractDestination in rpc call listunspent. For an large UTXO set the improvement are more notable.

This PR moves the computation of multiple ExtractDestination to a single call, and also reorganizes the code of building the JSON result of each UTXO.

@laanwj laanwj added the Wallet label Apr 6, 2016
@pedrobranco pedrobranco force-pushed the enhancement/prevent-multiple-calls-extractdestination branch from 47aeacf to 4a7c2f4 Compare April 6, 2016 12:11
@dcousens
Copy link
Contributor

dcousens commented Apr 7, 2016

utACK 4a7c2f4

@laanwj
Copy link
Member

laanwj commented Apr 9, 2016

Concept ACK

@paveljanik
Copy link
Contributor

ACK 4a7c2f4

To get more people looking at this, please provide some interesting numbers ;-))

@pedrobranco
Copy link
Contributor Author

The performance improvement isn't much significant on typical wallets. The main advantage is the reuse of the function ExtractDestination( and the organization of listunspent call.

@NicolasDorier
Copy link
Contributor

NicolasDorier commented May 5, 2016

I would add this condition so it is equivalent to before:

if(!fValidAddress && setAddress.size() > 0)
    continue;

@pedrobranco
Copy link
Contributor Author

@NicolasDorier You are right. Will fix.

@pedrobranco pedrobranco force-pushed the enhancement/prevent-multiple-calls-extractdestination branch 2 times, most recently from fd70385 to 83153e6 Compare May 5, 2016 09:36
@NicolasDorier
Copy link
Contributor

NicolasDorier commented May 5, 2016

utACK 83153e6 (nit: redeemScript does not appear in the help message.)

@pedrobranco pedrobranco force-pushed the enhancement/prevent-multiple-calls-extractdestination branch from 83153e6 to 289bb60 Compare May 6, 2016 09:47
@pedrobranco pedrobranco force-pushed the enhancement/prevent-multiple-calls-extractdestination branch from 289bb60 to 0bf6f30 Compare May 6, 2016 10:03
@sipa
Copy link
Member

sipa commented Jun 2, 2016

utACK 0bf6f30

@jonasschnelli
Copy link
Contributor

Core-Review utACK 0bf6f30

@sipa sipa merged commit 0bf6f30 into bitcoin:master Jun 2, 2016
sipa added a commit that referenced this pull request Jun 2, 2016
0bf6f30 Prevent multiple calls to ExtractDestination (Pedro Branco)
@pedrobranco pedrobranco deleted the enhancement/prevent-multiple-calls-extractdestination branch June 3, 2016 09:35
codablock pushed a commit to codablock/dash that referenced this pull request Dec 22, 2017
0bf6f30 Prevent multiple calls to ExtractDestination (Pedro Branco)
zkbot added a commit to zcash/zcash that referenced this pull request Apr 23, 2018
Bech32 encoding support and t-addr encoding refactor

Cherry-picked from the following upstream PRs:

- bitcoin/bitcoin#7922
- bitcoin/bitcoin#7825
- bitcoin/bitcoin#8317
- bitcoin/bitcoin#9804
  - Only the commit that changed `base58.cpp`
- bitcoin/bitcoin#11117
- bitcoin/bitcoin#11259
- bitcoin/bitcoin#11167
  - Only the first three commits (the fourth commit depends on #2390, later ones are SegWit-specific).

Part of #3058.
zkbot added a commit to zcash/zcash that referenced this pull request May 1, 2018
Upstream encoding cleanups

Cherry-picked from the following upstream PRs:

- bitcoin/bitcoin#7922
- bitcoin/bitcoin#7825
- bitcoin/bitcoin#8317
- bitcoin/bitcoin#9804
  - Only the commit that changed `base58.cpp`

Precursor to #3202.
zkbot added a commit to zcash/zcash that referenced this pull request May 1, 2018
Upstream encoding cleanups

Cherry-picked from the following upstream PRs:

- bitcoin/bitcoin#7922
- bitcoin/bitcoin#7825
- bitcoin/bitcoin#8317
- bitcoin/bitcoin#9804
  - Only the commit that changed `base58.cpp`

Precursor to #3202.
andvgal pushed a commit to energicryptocurrency/gen2-energi that referenced this pull request Jan 6, 2019
0bf6f30 Prevent multiple calls to ExtractDestination (Pedro Branco)
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants