HomePhabricator

[Chronik] Add `-chronikperfstats` flag to write performance stats into…

Description

[Chronik] Add -chronikperfstats flag to write performance stats into <datadir>/perf

Summary:
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.

Test Plan: Resync indexer using -chronikperfstats, verify perf/resync_stats.txt is created.

Reviewers: Fabien, #bitcoin_abc

Reviewed By: Fabien, #bitcoin_abc

Differential Revision: https://reviews.bitcoinabc.org/D14397

Details

Provenance
tobias_ruckAuthored on Aug 22 2023, 11:00
tobias_ruckPushed on Aug 22 2023, 15:15
Reviewer
Restricted Project
Differential Revision
D14397: [Chronik] Add `-chronikperfstats` flag to write performance stats into <datadir>/perf
Parents
rABCbd61ea8d267b: faster HexStr => 13% faster blockToJSON
Branches
Unknown
Tags
Unknown