<p>Previous version had several performance issues:</p>
<ul>
<li>We kept tradeStatistics in a lookup map in memory (about 40 MB)</li>
<li>We built up the StatefulAssets even if it was not used/needed.<br>
Building the StatefulAssets was an expensive call.</li>
<li>AssetTradeActivityCheck was only used for printing out statistics and<br>
called on startup causing performance cost.</li>
</ul>
<p>Optimized version:</p>
<ul>
<li>We call build the StatefulAssets only on demand (user activates<br>
view). Method call takes now 22 ms.</li>
<li>We create a optimized lookup map with a tuple of the data we need<br>
and keep it as local variable.</li>
<li>We removed AssetTradeActivityCheck.</li>
</ul>
<p>Thanks to the profiling reporting from:<br>
<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="585180727" data-permission-text="Title is private" data-url="https://github.com/bisq-network/proposals/issues/199" data-hovercard-type="issue" data-hovercard-url="/bisq-network/proposals/issues/199/hovercard" href="https://github.com/bisq-network/proposals/issues/199">bisq-network/proposals#199</a></p>

<p>Fixes #replaceWithIssueNr, fixes #replaceWithIssueNr</p>
<p>Your PR description here.</p>

<hr>

<h4>You can view, comment on, or merge this pull request online at:</h4>
<p>  <a href='https://github.com/bisq-network/bisq/pull/4409'>https://github.com/bisq-network/bisq/pull/4409</a></p>

<h4>Commit Summary</h4>
<ul>
  <li>Optimize AssetService</li>
</ul>

<h4>File Changes</h4>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4409/files#diff-e5c845c57dc70b70babcf8032d5b0e32">core/src/main/java/bisq/core/app/BisqSetup.java</a>
    (11)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4409/files#diff-1a0f75279e7543281a44e8af5802a641">core/src/main/java/bisq/core/dao/governance/asset/AssetService.java</a>
    (291)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4409/files#diff-ba36b396d3a64d73184712e991aaec72">core/src/main/java/bisq/core/trade/TradeModule.java</a>
    (2)
  </li>
  <li>
    <strong>D</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4409/files#diff-8a275b2da49f8866646e4efb02ba039b">core/src/main/java/bisq/core/trade/statistics/AssetTradeActivityCheck.java</a>
    (222)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4409/files#diff-7ffa78e9e56a72b369ed1c20fa01d486">desktop/src/main/java/bisq/desktop/main/dao/burnbsq/assetfee/AssetFeeView.java</a>
    (53)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/bisq-network/bisq/pull/4409.patch'>https://github.com/bisq-network/bisq/pull/4409.patch</a></li>
  <li><a href='https://github.com/bisq-network/bisq/pull/4409.diff'>https://github.com/bisq-network/bisq/pull/4409.diff</a></li>
</ul>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/bisq-network/bisq/pull/4409">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AJFFTNQ7SXE3NTEDN6HRXS3SAMAVHANCNFSM4P5JSZEA">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AJFFTNTX6KTVBA5VOTOT5IDSAMAVHA5CNFSM4P5JSZEKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4KDJF7FA.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/bisq-network/bisq/pull/4409",
"url": "https://github.com/bisq-network/bisq/pull/4409",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>