HomePhabricator

[Chronik] Optimize `Subs` by short-circuiting if empty

Description

[Chronik] Optimize Subs by short-circuiting if empty

Summary:
Currently, quite a bit of time is spent in handle_tx_event during IBD, even if there's no subscribers.

When syncing the first 30000ish blocks with all indices disabled (i.e. only loading of blocks etc.), we shave off around 150s. Most of this comes from ScriptGroup allocating 2 Vecs for each txs, which is mostly fixed by D15545, however, there's still a remainder of 30s overhead which this diff saves.

benchtime [s]
master969.39
this diff821.10s
master + D15545850.29s

Test Plan: ninja check-functional

Reviewers: Fabien, #bitcoin_abc

Reviewed By: Fabien, #bitcoin_abc

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

Details

Provenance
tobias_ruckAuthored on Feb 26 2024, 14:28
tobias_ruckPushed on Feb 26 2024, 16:18
Reviewer
Restricted Project
Differential Revision
D15552: [Chronik] Optimize `Subs` by short-circuiting if empty
Parents
rABC5fa57e695aa6: [Chronik] Use `merge_cf` in `reverse_lookup.rs` to speed up indexing.
Branches
Unknown
Tags
Unknown