The scriptpubkeyman harness is slow - I’m getting under 40 exec/s on my personal server. This PR solves the following issues that may be affecting the performance:
- There are redundant
IsMinecalls ConsumeCoinsalways create up to 10'000 coins which may cause slowness.- There are some expensive ops in a loop - e.g. One of the slow units I got on my server is about a repeated sequence of
GetNewDestinationcalls (see flamegraph below). - We’re always calling
GetDescriptorStringunconditionally. It looks like an inofensive function but this is extremely costly due to calls toToNormalizedString/ToPrivateStringfunctions that touch key operations. - Not related to slowness, but there is a bug on harness because we are aborting the execution when we cannot update the wallet descriptor, we can just skip and continue.