Page MenuHomePhabricator

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

Authored by tobias_ruck on Feb 26 2024, 15:08.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABCe4fcd7c96069: [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

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision is now accepted and ready to land.Feb 26 2024, 15:27