From 295ea482a1abc44d2ab9ff4f0fc337dcc01fbe96 Mon Sep 17 00:00:00 2001 From: Kang Date: Fri, 1 Sep 2023 19:02:33 +0800 Subject: [PATCH] [improvement](log) optimize template function log for performance (#23746) change log level to debug and use format in template function log for performance. --- .../org/apache/doris/catalog/FunctionSet.java | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/catalog/FunctionSet.java b/fe/fe-core/src/main/java/org/apache/doris/catalog/FunctionSet.java index 2e87bbdad1..cde3cecf17 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/catalog/FunctionSet.java +++ b/fe/fe-core/src/main/java/org/apache/doris/catalog/FunctionSet.java @@ -345,10 +345,12 @@ public class FunctionSet { public Function specializeTemplateFunction(Function templateFunction, Function requestFunction, boolean isVariadic) { try { boolean hasTemplateType = false; - LOG.debug("templateFunction signature: " + templateFunction.signatureString() - + " return: " + templateFunction.getReturnType()); - LOG.debug("requestFunction signature: " + requestFunction.signatureString() - + " return: " + requestFunction.getReturnType()); + if (LOG.isDebugEnabled()) { + LOG.debug("templateFunction signature: {}, return type: {}", + templateFunction.signatureString(), templateFunction.getReturnType()); + LOG.debug("requestFunction signature: {}, return type: {}", + requestFunction.signatureString(), requestFunction.getReturnType()); + } List newArgTypes = Lists.newArrayList(); List newRetType = Lists.newArrayList(); if (isVariadic) { @@ -397,12 +399,14 @@ public class FunctionSet { specializedFunction.getReturnType().specializeTemplateType( requestFunction.getReturnType(), specializedTypeMap, true)); } - LOG.debug("specializedFunction signature: " + specializedFunction.signatureString() - + " return: " + specializedFunction.getReturnType()); + if (LOG.isDebugEnabled()) { + LOG.debug("specializedFunction signature: {}, return type: {}", + specializedFunction.signatureString(), specializedFunction.getReturnType()); + } return hasTemplateType ? specializedFunction : templateFunction; } catch (TypeException e) { - if (inited) { - LOG.warn("specializeTemplateFunction exception", e); + if (inited && LOG.isDebugEnabled()) { + LOG.debug("specializeTemplateFunction exception", e); } return null; }