Collect performance stats for TxWriter, SpentByWriter, GroupUtxoWriter and GroupHistoryWriter, which are the biggest culprits regarding performance at the moment.
Add *Stats structs for each of them, but also *MemData structs, which allows later optimizations to store in-memory caches etc.
Bundle all of them in MemData, which can be mapped to StatsData to obtain just the stats.
After resync_indexer completed, write the collected data to perf/resync_stats.txt. In the future, we might add other kinds of files.