Page MenuHomePhabricator

[core#19011 3/3] Reduce cs_main lock accumulation during GUI startup

Authored by PiRK on Mon, Jul 5, 07:58.



PR description:

During the GUI startup, there is currently an accumulation of cs_main locks due to setting initial chain state values at multiple locations (in the GUI main thread).

This PR tries to cache the initial chain state (tip height, tip time, best header, etc.) short after loading the blockindex.

The cached values are then used instead of fetching them again (and thus locking cs_main) during setting the client model.

This should fix the initial GUI blocking often experienced during or short after the splashscreen.

This concludes backport of core#19011 [4/4]

Depends on D9735
Depends on D9737

Test Plan

ninja all check-all

Diff Detail

rABC Bitcoin ABC
Lint Not Applicable
Tests Not Applicable

Event Timeline

PiRK requested review of this revision.Mon, Jul 5, 07:58
1225 ↗(On Diff #29060)

This and the following changes to this file is the linter's work

PiRK planned changes to this revision.Mon, Jul 5, 08:19

It is better to backport core#19104 for this one

PiRK edited the summary of this revision. (Show Details)

rebase on D9737, fix RegisterMetaTypes

Fabien added inline comments.
1223 ↗(On Diff #29062)

There is something weird with your linter, mine is reverting the changes

downgrade clang-format from version 12 to 10

This undoes the unrelated changes. clang-format-8 has been obsoleted in the latest ubuntu version and in the LLVM install script.

This revision is now accepted and ready to land.Mon, Jul 5, 19:02