[improvement](log) optimize template function log for performance (#23746)

change log level to debug and use format in template function log for performance.
This commit is contained in:
Kang
2023-09-01 19:02:33 +08:00
committed by GitHub
parent 0b94eee4c7
commit 295ea482a1

View File

@ -345,10 +345,12 @@ public class FunctionSet<T> {
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<Type> newArgTypes = Lists.newArrayList();
List<Type> newRetType = Lists.newArrayList();
if (isVariadic) {
@ -397,12 +399,14 @@ public class FunctionSet<T> {
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;
}