On wallets with many coins for few addresses, add_input_info is called a lot for the same addresses. Avoid costly and unnecessary get_address_unspent calls by caching the result for each addreess.
Remove the same optimization done for the coin consolidation tool and use the newly optimized wallet.add_input_info
Profiling:
Annotate AbstractWallet.make_unsigned_transaction with @profiler, run the application in verbose mode (./electrum-abc -v), open the IFP address wallet, select 500 coins and choose "Spend" in the dropdown menu, go to the send tab and type something in the Amount widget
Before:
[profiler] AbstractWallet.make_unsigned_transaction 33.5602 [profiler] AbstractWallet.make_unsigned_transaction 33.5048
After:
[profiler] AbstractWallet.make_unsigned_transaction 0.0926 [profiler] AbstractWallet.make_unsigned_transaction 0.0909
Depends on D14248