<p>Remove toProto call just for debug logs. That was quite expensive at we called tha for each message sent.</p>
<p>Cleanup some logs and apply code inspection suggestion for common module.</p>
<p>Regarding logging:</p>
<ul>
<li>We should always use params,, then the method calls at the params are not executed if log level does not match, thus adding very tiny overhead to have a log.</li>
</ul>
<p>isDebugEnabled() is not recommended if params are used. It caused more performance costs and adds boilerplate code.</p>
<p>See:<br>
<a rel="nofollow" href="http://logging.apache.org/log4j/1.2/manual.html">http://logging.apache.org/log4j/1.2/manual.html</a><br>
"This will not incur the cost of parameter construction if debugging is disabled. On the other hand, if the logger is debug-enabled, it will incur twice the cost of evaluating whether the logger is enabled or not: once in debugEnabled and once in debug. This is an insignificant overhead because evaluating a logger takes about 1% of the time it takes to actually log."</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/4573'>https://github.com/bisq-network/bisq/pull/4573</a></p>

<h4>Commit Summary</h4>
<ul>
  <li>Remove toProtoNetworkEnvelope call.</li>
  <li>Remove isDebugEnabled if not needed.</li>
  <li>Use params for trace logs.</li>
  <li>Delete unused class</li>
  <li>Remove not needed stream()</li>
  <li>Use final</li>
  <li>Simplify statements</li>
  <li>Apply code inspection suggestions</li>
</ul>

<h4>File Changes</h4>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4573/files#diff-3979b63542214bc336370239241ad111">common/src/main/java/bisq/common/MasterTimer.java</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4573/files#diff-f1c1c294315c7864d34332ca42c3392d">common/src/main/java/bisq/common/app/Capabilities.java</a>
    (1)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4573/files#diff-911226031c3a3eba0dac26e854487fff">common/src/main/java/bisq/common/config/BaseCurrencyNetwork.java</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4573/files#diff-18d9f088089d1e186053d0c857073f57">common/src/main/java/bisq/common/config/BisqHelpFormatter.java</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4573/files#diff-9528e70f6dabc9e219b668e538aef00c">common/src/main/java/bisq/common/config/Config.java</a>
    (3)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4573/files#diff-e017263426c86b3b44ebe65f69288abe">common/src/main/java/bisq/common/crypto/Encryption.java</a>
    (6)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4573/files#diff-84744a4d2ed71c0e9a6d55ad41bf354b">common/src/main/java/bisq/common/crypto/PubKeyRingProvider.java</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4573/files#diff-991728283c5440dc4f20adf0df5f765b">common/src/main/java/bisq/common/crypto/Sig.java</a>
    (6)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4573/files#diff-e3254db84514d111b29e581baef1d305">common/src/main/java/bisq/common/proto/persistable/UserThreadMappedPersistableEnvelope.java</a>
    (1)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4573/files#diff-505413cf381ccc72c841068b187f9a6a">common/src/main/java/bisq/common/storage/CorruptedDatabaseFilesHandler.java</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4573/files#diff-da0c14fbd6b9b0a2cdf500d353864623">common/src/main/java/bisq/common/storage/FileManager.java</a>
    (1)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4573/files#diff-e318ae50078741f40a134b64f5bb08d7">common/src/main/java/bisq/common/storage/FileUtil.java</a>
    (4)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4573/files#diff-56bba52dc18a996f91f96d4829e90d59">common/src/main/java/bisq/common/util/DesktopUtil.java</a>
    (5)
  </li>
  <li>
    <strong>D</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4573/files#diff-f043d676d530ad6e3c21ed887cac625e">common/src/main/java/bisq/common/util/FunctionalReadWriteLock.java</a>
    (87)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4573/files#diff-e607d2f229586024e12b6089b6ecd087">common/src/main/java/bisq/common/util/MathUtils.java</a>
    (8)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4573/files#diff-2766cb2f2ba0694ce0184276106f8092">common/src/main/java/bisq/common/util/Utilities.java</a>
    (4)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4573/files#diff-81116ad8e32652a73d8349d5fe7d86d1">core/src/main/java/bisq/core/dao/node/lite/network/LiteNodeNetworkService.java</a>
    (1)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4573/files#diff-2f3acf8ed04280106b282ca1a2e2ddde">core/src/main/java/bisq/core/support/dispute/agent/DisputeAgentService.java</a>
    (4)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4573/files#diff-ad25145d2a5b56a4bcf0c91856f279de">core/src/main/java/bisq/core/support/dispute/arbitration/ArbitrationManager.java</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4573/files#diff-e6b8fcf17af82ba32ef86ed7b7aa817e">core/src/test/java/bisq/core/crypto/SigTest.java</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4573/files#diff-dcdbc6a034a83164c59b7128d14a831b">p2p/src/main/java/bisq/network/p2p/network/Connection.java</a>
    (32)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4573/files#diff-abf37438b61275138b85e72d9c205cb8">p2p/src/main/java/bisq/network/p2p/network/NetworkNode.java</a>
    (33)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4573/files#diff-a68598a1286ab69eb9ef04051f87f246">p2p/src/main/java/bisq/network/p2p/peers/PeerManager.java</a>
    (7)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4573/files#diff-dc73ff902bbde82f343a308973e8128c">p2p/src/main/java/bisq/network/p2p/peers/getdata/RequestDataHandler.java</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4573/files#diff-cd4b458a28a28cb331769c16bd042b20">p2p/src/main/java/bisq/network/p2p/peers/peerexchange/PeerExchangeManager.java</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4573/files#diff-926901286366061dc8575034045cb922">p2p/src/main/java/bisq/network/p2p/storage/P2PDataStorage.java</a>
    (4)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/bisq-network/bisq/pull/4573.patch'>https://github.com/bisq-network/bisq/pull/4573.patch</a></li>
  <li><a href='https://github.com/bisq-network/bisq/pull/4573.diff'>https://github.com/bisq-network/bisq/pull/4573.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/4573">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AJFFTNVYGMN5RWDFNAJQDO3SIIPTDANCNFSM4R6EBUVQ">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AJFFTNWBY7ZO23KYEDBWY5TSIIPTDA5CNFSM4R6EBUV2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4KTGGEGQ.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/4573",
"url": "https://github.com/bisq-network/bisq/pull/4573",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>