[bisq-network/bisq] Remove debug logs (#4573)

chimp1984 notifications at github.com
Tue Sep 29 18:13:05 UTC 2020


Remove toProto call just for debug logs. That was quite expensive at we called tha for each message sent.

Cleanup some logs and apply code inspection suggestion for common module.

Regarding logging:
- 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.

isDebugEnabled() is not recommended if params are used. It caused more performance costs and adds boilerplate code.

See:
http://logging.apache.org/log4j/1.2/manual.html
"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."
You can view, comment on, or merge this pull request online at:

  https://github.com/bisq-network/bisq/pull/4573

-- Commit Summary --

  * Remove toProtoNetworkEnvelope call.
  * Remove isDebugEnabled if not needed.
  * Use params for trace logs.
  * Delete unused class
  * Remove not needed stream()
  * Use final
  * Simplify statements
  * Apply code inspection suggestions

-- File Changes --

    M common/src/main/java/bisq/common/MasterTimer.java (2)
    M common/src/main/java/bisq/common/app/Capabilities.java (1)
    M common/src/main/java/bisq/common/config/BaseCurrencyNetwork.java (2)
    M common/src/main/java/bisq/common/config/BisqHelpFormatter.java (2)
    M common/src/main/java/bisq/common/config/Config.java (3)
    M common/src/main/java/bisq/common/crypto/Encryption.java (6)
    M common/src/main/java/bisq/common/crypto/PubKeyRingProvider.java (2)
    M common/src/main/java/bisq/common/crypto/Sig.java (6)
    M common/src/main/java/bisq/common/proto/persistable/UserThreadMappedPersistableEnvelope.java (1)
    M common/src/main/java/bisq/common/storage/CorruptedDatabaseFilesHandler.java (2)
    M common/src/main/java/bisq/common/storage/FileManager.java (1)
    M common/src/main/java/bisq/common/storage/FileUtil.java (4)
    M common/src/main/java/bisq/common/util/DesktopUtil.java (5)
    D common/src/main/java/bisq/common/util/FunctionalReadWriteLock.java (87)
    M common/src/main/java/bisq/common/util/MathUtils.java (8)
    M common/src/main/java/bisq/common/util/Utilities.java (4)
    M core/src/main/java/bisq/core/dao/node/lite/network/LiteNodeNetworkService.java (1)
    M core/src/main/java/bisq/core/support/dispute/agent/DisputeAgentService.java (4)
    M core/src/main/java/bisq/core/support/dispute/arbitration/ArbitrationManager.java (2)
    M core/src/test/java/bisq/core/crypto/SigTest.java (2)
    M p2p/src/main/java/bisq/network/p2p/network/Connection.java (32)
    M p2p/src/main/java/bisq/network/p2p/network/NetworkNode.java (33)
    M p2p/src/main/java/bisq/network/p2p/peers/PeerManager.java (7)
    M p2p/src/main/java/bisq/network/p2p/peers/getdata/RequestDataHandler.java (2)
    M p2p/src/main/java/bisq/network/p2p/peers/peerexchange/PeerExchangeManager.java (2)
    M p2p/src/main/java/bisq/network/p2p/storage/P2PDataStorage.java (4)

-- Patch Links --

https://github.com/bisq-network/bisq/pull/4573.patch
https://github.com/bisq-network/bisq/pull/4573.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/bisq-network/bisq/pull/4573
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20200929/7461bea2/attachment-0001.html>


More information about the bisq-github mailing list