Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speed up BSQ supply view load #3956

Merged
merged 2 commits into from
Feb 17, 2020

Conversation

stejbac
Copy link
Contributor

@stejbac stejbac commented Feb 10, 2020

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

* Use Java Time instead of java.sql.Date for local date calculations;
* Avoid raw types & unsafe varargs warnings;
* Fix false compiler error in IDEA due to discrepancy with javac;
* Formatting & method visibility.
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.
Copy link
Contributor

@ripcurlx ripcurlx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK

Tested it no Mainnet and everything is working as before. Code changes are looking fine.

@ripcurlx ripcurlx merged commit 0facdc9 into bisq-network:master Feb 17, 2020
@ripcurlx ripcurlx added the is:priority PR or issue marked with this label is up for compensation label Feb 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
is:priority PR or issue marked with this label is up for compensation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants