during block-chain download: high CPU load + GUI lags + addresses don't stay selected and lose focus (0.6.1 RC1) #1154

issue Diapolo opened this issue on April 27, 2012
  1. Diapolo commented at 2:21 PM on April 27, 2012: none

    Verified for 0.6.1 RC1 on Windows 7 x64:

    • start Bitcoin-Qt with only addr.dat, walled.dat and bitcoin.cfg files in the datadir
    • click on an (receiving) address in your list while block-chain is downloading / syncing
    • address is selected and marked active
    • focus get's lost and address is inactive

    This seems to happen everytime a new block is received, seem there is some GUI re-draw triggered that makes this focus loss happen.

    Additionally I have GUI lags while downloading the block-chain + a way to high CPU load!

  2. rebroad commented at 2:14 PM on April 28, 2012: contributor

    can you elaborate please?

  3. Diapolo commented at 5:02 PM on April 28, 2012: none

    Updated initial posting!

  4. Diapolo commented at 9:59 AM on April 29, 2012: none

    Not that is interesting, as long as the current checkpoint is active which has 168000 blocks there is no lag and no problem with selecting addresses from the list, but as soon as the current block count is recieved by a node the client starts to lag / missbehave.

  5. Diapolo commented at 10:19 AM on April 29, 2012: none

    The focus loss for addresses is indeed related to MainFrameRepaint(), if I simply empty this function no focus loss occurs. The problem with the GUI lag is that I can't reproduce it with my own builds and it only happens with the official 0.6.1 RC1 :-/.

  6. Diapolo commented at 10:30 AM on April 29, 2012: none

    @laanwj I need your help here, have you got any ideas? I guess it is related to your commit https://github.com/bitcoin/bitcoin/commit/98e61758744ed34e8b7f59b37edb6d09b33d5517

  7. laanwj commented at 11:11 AM on April 29, 2012: member

    The address loss-of-selection should only happen when AddressBookRepaint is called, which only happens when there is an actual change to the address book. I'm not sure why it would happen on MainFrameRepaint but that's wrong behaviour, I split them on purpose.

    The lag could be related. MainFrameRepaint is cheap, as "change" signals are only emitted by the models when something is found to have changed, However, AddressBookRepaint is an expensive operation, as it resynchronizes the address book, so if it somehow gets triggered every time... the expected performance would be abysmal.

  8. laanwj commented at 11:21 AM on April 29, 2012: member

    Found the problem. WalletModel::update calls addressTableModel->update() ... oh my...

    Thanks for spotting this.

  9. laanwj referenced this in commit 7e81ba6fe7 on Apr 29, 2012
  10. laanwj referenced this in commit 6974aff668 on Apr 29, 2012
  11. laanwj referenced this in commit 0acb1e715c on Apr 29, 2012
  12. laanwj commented at 11:50 AM on April 29, 2012: member

    This fixed the worst performance issue.

    However, MainFrameRepaint is still called a lot. Also, every time it scans the wallet and computes the balance.

    • We need some kind of rate limiting on MainFrameRepaints. There is no need to update the UI faster than say, 10 times per second, even if hundreds of blocks come in. The timer, combined with a flag maybe wasn't that bad an idea after all.
    • And it would be useful to make notifications more specific. Different notifications from the core whether the balance could have changed, or the number of blocks, or the number of connections... instead of a generic call. I made a start with AddressBookRepaint.
  13. Diapolo commented at 5:18 PM on April 29, 2012: none

    Thanks for your quick reaction, as I'm not advanced in Qt-GUI stuff I could not have fixed it by myself. But in terms of debugging and helping we are indeed a good team :).

    Will merge your fix into my local build and test it out.

    An update-rate limiter would be a great idea. Value could be once every sec while block-chain is downloading and on demand, if we are up-to date, as it should not happen very often then?

  14. Diapolo commented at 5:54 PM on April 29, 2012: none

    I can confirm addresses now stay again selected, but as I said I can't check if CPU usage or lag is fixed, as I didn't observe this with my own builds. @laanwj Shall I let this open until the next RC or will you work-out on further commits that address the problem, so this can be closed?

  15. laanwj commented at 7:29 PM on April 29, 2012: member

    Let's leave this open for now. I'll leave the other mentioned improvements for 0.7.0 as they're not as urgent as this one, and have the risk of introducing further issues into the release candidate. But it helps to leave this issue open to remind.

  16. Diapolo commented at 1:53 PM on May 11, 2012: none

    Reference to #1205

  17. Diapolo commented at 1:10 PM on May 20, 2012: none

    #1205 has improved the CPU usage during initial block download, but it feels still a bit hight. @laanwj How is CPU usage on Ubuntu with -debug -logtimestamps?

  18. laanwj commented at 2:16 PM on May 20, 2012: member

    Remember that the crypto during block chain download also takes quite some computational power. You should compare with a bitcoind in initial block download.

  19. rebroad commented at 11:01 AM on May 28, 2012: contributor

    Low. I don't see how these flags would make any significant difference to the CPU usage.

    Sent from my Nokia phone -----Original Message----- From: Philip Kaufmann Sent: 20/05/2012 14:10:49 Subject: Re: [bitcoin] during block-chain download: high CPU load + GUI lags + addresses don't stay selected and lose focus (0.6.1 RC1) (#1154)

    #1205 has improved the CPU usage during initial block download, but it feels still a bit hight. @laanwj How is CPU usage on Ubuntu with -debug -logtimestamps?


    Reply to this email directly or view it on GitHub: #1154 (comment)

  20. Diapolo closed this on Jun 1, 2012

  21. coblee referenced this in commit 4a389d62a1 on Jul 17, 2012
  22. coblee referenced this in commit e860b5cbd8 on Jul 17, 2012
  23. suprnurd referenced this in commit e84f393571 on Dec 5, 2017
  24. lateminer referenced this in commit 76eaef3841 on Jan 22, 2019
  25. Bushstar referenced this in commit d63fb572c3 on Oct 21, 2020
  26. MarcoFalke locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-13 21:16 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me