[
https://issues.apache.org/jira/browse/LOG4J2-772?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15030329#comment-15030329
]
Remko Popma commented on LOG4J2-772:
------------------------------------
One idea is to use the same system property {{log4j.format.msg.async}} that was
introduced in LOG4J2-898 to decide whether to postpone formatting the message
parameters. If this is easy to do I will try to do it this weekend.
> Performance enhancement: ParameterizedMessage should not take String
> snapshots of its parameters in constructor
> ---------------------------------------------------------------------------------------------------------------
>
> Key: LOG4J2-772
> URL: https://issues.apache.org/jira/browse/LOG4J2-772
> Project: Log4j 2
> Issue Type: Improvement
> Components: API
> Affects Versions: 2.0, 2.0.1
> Reporter: Remko Popma
> Labels: Performance
>
> Discovered during investigation for LOG4J2-763, {{ParameterizedMessage}}
> currently initializes its {{String[] stringArgs}} field in the constructor.
> This may be wasted work if the message is not used, for example because the
> log level is below the filter threshold.
> The {{stringArgs}} field should be initialized in the {{getFormattedString}}
> method, not earlier.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]