[bisq-network/bisq] Speed up "Synchronizing DAO" (#5484)

cd2357 notifications at github.com
Tue May 11 11:11:29 CEST 2021


`BlockParser.parseBlock()` normally takes about 300ms per block.

One part of it is checking if the new block hash is known, which was done by string-comparing it to the hashes of all known blocks. In my case, this was about 110 000 string-comparisons per `BlockParser.parseBlock()` call.

This commit adds a block hash cache in the `DaoState` and replaces the hash string-comparisons by one `HashSet` lookup.

With this change, `BlockParser.parseBlock()` takes around 200ms on my setup.
You can view, comment on, or merge this pull request online at:

  https://github.com/bisq-network/bisq/pull/5484

-- Commit Summary --

  * Improve timer accuracy in BlockParser
  * Cache block hashes in DaoState

-- File Changes --

    M core/src/main/java/bisq/core/dao/node/parser/BlockParser.java (5)
    M core/src/main/java/bisq/core/dao/state/DaoStateService.java (3)
    M core/src/main/java/bisq/core/dao/state/model/DaoState.java (17)

-- Patch Links --

https://github.com/bisq-network/bisq/pull/5484.patch
https://github.com/bisq-network/bisq/pull/5484.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/bisq-network/bisq/pull/5484
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20210511/8b230ff1/attachment.htm>


More information about the bisq-github mailing list