From c3e42d7c73c92824f42be73aa32c206ac0f12e53 Mon Sep 17 00:00:00 2001 From: Baoyi Chen Date: Thu, 20 Oct 2022 10:56:08 +0800 Subject: [PATCH] Add log.isDebugEnabled() to reduce string allocation Signed-off-by: Baoyi Chen --- .../org/eclipse/jetty/websocket/core/AbstractExtension.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/AbstractExtension.java b/jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/AbstractExtension.java index ffc8f1cbf415..7baee9ddfcf7 100644 --- a/jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/AbstractExtension.java +++ b/jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/AbstractExtension.java @@ -140,13 +140,15 @@ public boolean isRsv3User() protected void nextIncomingFrame(Frame frame, Callback callback) { - log.debug("nextIncomingFrame({})", frame); + if (log.isDebugEnabled()) + log.debug("nextIncomingFrame({})", frame); this.nextIncoming.onFrame(frame, callback); } protected void nextOutgoingFrame(Frame frame, Callback callback, boolean batch) { - log.debug("nextOutgoingFrame({})", frame); + if (log.isDebugEnabled()) + log.debug("nextOutgoingFrame({})", frame); this.nextOutgoing.sendFrame(frame, callback, batch); }