You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by "Remko Popma (JIRA)" <ji...@apache.org> on 2016/02/14 13:04:18 UTC

[jira] [Closed] (LOG4J2-1272) Improve LoggerConfig's data structure for AppenderControl objects

     [ https://issues.apache.org/jira/browse/LOG4J2-1272?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Remko Popma closed LOG4J2-1272.
-------------------------------

> Improve LoggerConfig's data structure for AppenderControl objects
> -----------------------------------------------------------------
>
>                 Key: LOG4J2-1272
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-1272
>             Project: Log4j 2
>          Issue Type: Improvement
>          Components: Core
>    Affects Versions: 2.5
>            Reporter: Remko Popma
>            Assignee: Remko Popma
>             Fix For: 2.6
>
>
> LoggerConfig#callAppenders is performance sensitive since it is called for every LogEvent. Currently the AppenderControl objects are stored in a CopyOnWriteArraySet which is a very good fit for its intended use (vastly more reads than writes, writes may happen concurrently in different threads), but the disadvantage of this data structure is that it creates a new Iterator instance each time we need to traverse its contents.
> We can do slightly better than this by storing the objects in an array and keep this array in an AtomicReference. The array can be traversed by index without allocating new objects.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org