Remko Popma created LOG4J2-1272:
-----------------------------------

             Summary: 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


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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to