`TxWriter` is surprizingly slow considering what it does is very simple, however, the bottleneck is `LookupIndex`, which in `insert_pairs` reads from the DB before updating, which is very slow.
Instead, use merge_cf like in D14430, which avoids that roundrip, and RocksDB is able to combine a read+write efficiently for us.
To resync the first 300000-ish blocks, with all other indices disabled (i.e. only TxWriter), we get an overall speedup of almost 2x. Note that this still includes reading the blocks from disk etc. The `insert` call itself is now extremely fast, because it basically just issues a bunch of `merge_cf` calls, and the real action is handled by RocksDB, so benchmarking the call isn't too useful anymore.
| bench | total time [s] | time TxWriter::insert [s] |
| master | 2378.86 | 1134.73 |
| merge_cf | 1212.08 | 36.9 |
Depends on D15547