You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Remko Popma (JIRA)" <ji...@apache.org> on 2018/02/26 10:17:00 UTC
[jira] [Comment Edited] (LOG4J2-2253) Reusable messages missing a
garbage free parameter accessor
[ https://issues.apache.org/jira/browse/LOG4J2-2253?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16376623#comment-16376623 ]
Remko Popma edited comment on LOG4J2-2253 at 2/26/18 10:16 AM:
---------------------------------------------------------------
Planning to merge this with one modification: I'll change
{code}
interface ParameterVisitableMessage extends Message
{code}
to
{code}
interface ParameterVisitable
{code}
About the {{ParameterConsumer}} interface: any reason why the parameter index is a {{short}} instead of an {{int}}? That means some occasional type-casting on the part of the implementors for no gain that I can see, but perhaps I'm missing something...
was (Author: remkop@yahoo.com):
Planning to merge this with one modification: I'll change
{code}
interface ParameterVisitableMessage extends Message
{code}
to
{code}
interface ParameterVisitable
{code}
Any reason why the parameter index is a {{short}} instead of an {{int}}? That means some occasional type-casting on the part of the implementors for no gain that I can see, but perhaps I'm missing something...
> Reusable messages missing a garbage free parameter accessor
> -----------------------------------------------------------
>
> Key: LOG4J2-2253
> URL: https://issues.apache.org/jira/browse/LOG4J2-2253
> Project: Log4j 2
> Issue Type: Improvement
> Reporter: Carter Douglas Kozak
> Assignee: Remko Popma
> Priority: Major
>
> I have a layout which iterates through message parameters, however Message.getParameters causes allocation on many implementations.
> It appears that ReusableMessage.swapParameters is supposed to fill this gap, however some messages types do allocation when this is invoked (see ReusableParameterizedMessage) which isn't helpful for access on a single thread where we don't want to take ownership of values.
> I've put together a proposal for an accessor similar to MapMessage:
> https://github.com/apache/logging-log4j2/pull/150
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)