[bisq-network/bisq] Speed up BSQ supply view load (#3956)

Steven Barclay notifications at github.com
Mon Feb 10 05:59:40 UTC 2020

- make yourself familiar with the CONTRIBUTING.md if you have not already (https://github.com/bisq-network/bisq/blob/master/CONTRIBUTING.md)
- make sure you follow our [coding style guidelines][https://github.com/bisq-network/style/issues)
- pick a descriptive title
- provide some meaningful PR description below
- create the PR
- in case you receive a "Change request" and/or a NACK, please react within 30 days. If not, we will close your PR and it can not be up for compensation.
- After addressing the change request, __please re-request a review!__ Otherwise we might miss your PR as we tend to only look at pull requests tagged with a "review required".

When displaying the monthly BSQ issued series, avoid repeatedly calling `DaoFacade.getBlockTime` for Issuance objects with the same chain height, as that method linearly scans the entire linked list of `DaoState` blocks, making it quite slow. Instead, memoise the mapping from chain height to block-time month, so that it is only computed once per graph point instead of once for every BSQ issuance.

Also do some minor cleanup of `SupplyView`, including a compilation error flagged incorrectly by IntelliJ, caused by the raw typed constructor reference `XYChart.Data::new`.


Repeatedly switching to the _BSQ Supply_ tab under _Facts & Figures_ revealed the following minor hotspot in JProfiler (fixed by the above):

![Screenshot from 2020-02-10 05-55-53](https://user-images.githubusercontent.com/54855381/74124381-0e15ad00-4bca-11ea-8017-d38a88ea8be8.png)

You can view, comment on, or merge this pull request online at:


-- Commit Summary --

  * Do some minor tidying of DAO SupplyView
  * Memoise block times to speed up display of BSQ issued graph

-- File Changes --

    M desktop/src/main/java/bisq/desktop/main/dao/economy/supply/SupplyView.java (82)

-- Patch Links --


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20200209/2765e07a/attachment.html>

More information about the bisq-github mailing list