There is a fair amount of work going into the indices at the moment, and no cheap way to tell whether a change is promising, or whether it actually improves what it set out to improve. Checking it end to end means a full IBD. The only index benchmark in the tree, BlockFilterIndexSync, syncs coinbase-only blocks, so it cannot show anything that scales with the number of inputs or outputs per block, and there is none at all for TxIndex or TxoSpenderIndex.
This adds shared helpers in src/bench/index_sync_util.{h,cpp} that build a chain of blocks with chained, validly-signed transactions (~2 inputs and ~2 outputs each, every output paying to a distinct key), and three benchmarks on top of them, applied to txindex, txospenderindex and blockfilterindex:
<Index>SyncDisk: full sync against a disk-backed LevelDB, the real write path.<Index>SyncMem: the same in memory; the difference againstSyncDiskseparates I/O from CPU.<Index>Lookup: one query per key known to be in the index (FindTx,FindSpender).
The existing coinbase-only BlockFilterIndexSync is left untouched. The whole suite runs in well under a minute.
A last commit documents in doc/benchmarking.md how to measure syscalls, on-disk size and peak memory around bench_bitcoin, which nanobench does not report. Which of those matters depends on the change: on-disk size is the whole point of #35531, while peak memory is the open question in #34489. Being able to measure them alongside the benchmark seems generally useful, so that section is written for any benchmark, not just these.
I have used this on those two pull requests, and in both the interesting number was one the existing benchmark could not produce: #35531 (5-byte siphash keys) trades a 49% smaller index on disk for a lookup regression that grows with index size, and #34489 (batch db writes) cuts write syscalls by 91% with CPU unchanged. The numbers are in those threads.