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

Optimize AssetService #4409

Merged
merged 4 commits into from
Aug 22, 2020
Merged

Conversation

chimp1984
Copy link
Contributor

@chimp1984 chimp1984 commented Aug 12, 2020

Previous version had several performance issues:

  • We kept tradeStatistics in a lookup map in memory (about 40 MB)
  • We built up the StatefulAssets even if it was not used/needed.
    Building the StatefulAssets was an expensive call.
  • AssetTradeActivityCheck was only used for printing out statistics and
    called on startup causing performance cost.

Optimized version:

  • We call build the StatefulAssets only on demand (user activates
    view). Method call takes now 22 ms.
  • We create a optimized lookup map with a tuple of the data we need
    and keep it as local variable.
  • We removed AssetTradeActivityCheck.

Thanks to the profiling reporting from:
bisq-network/proposals#199

Previous version had several performance issues:
- We kept tradeStatistics in a lookup map in memory (about 40 MB)
- We built up the StatefulAssets even if it was not used/needed.
Building the StatefulAssets was an expensive call.
- AssetTradeActivityCheck was only used for printing out statistics and
called on startup causing performance cost.

Optimized version:
- We call build the StatefulAssets only on demand (user activates
view). Method call takes now 22 ms.
- We create a optimized lookup map with a tuple of the data we need
and keep it as local variable.
- We removed AssetTradeActivityCheck.

Thanks to the profiling reporting from:
bisq-network/proposals#199
Private constructors are OK if injection is used.
Empty methods are also ok if requires for interface...
@ripcurlx ripcurlx requested a review from sqrrm August 19, 2020 10:56
Copy link
Member

@sqrrm sqrrm left a comment

Choose a reason for hiding this comment

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

Looks good. Would prefer to have pure refactoring as separate commits for easier review.

Added a couple of suggestions before merging.

Needs review from @ManfredKarrer since it touches core/dao

@chimp1984
Copy link
Contributor Author

Would prefer to have pure refactoring as separate commits for easier review.

Agree. Sorry.

@ManfredKarrer
Copy link
Contributor

utACK

Copy link
Member

@sqrrm sqrrm left a comment

Choose a reason for hiding this comment

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

ACK

@sqrrm sqrrm merged commit b512e31 into bisq-network:master Aug 22, 2020
@chimp1984 chimp1984 deleted the optimize-AssetService branch August 23, 2020 00:29
@ripcurlx ripcurlx added this to the v1.3.8 milestone Aug 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants