[ 
https://issues.apache.org/jira/browse/METRON-2195?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16894738#comment-16894738
 ] 

Simon Elliston Ball commented on METRON-2195:
---------------------------------------------

[https://logging.apache.org/log4j/2.x/performance.html]

See the section on asynchronous parameter evaluation. That said, method calls 
may not be lazy evaluated in that case judging by Mike's results. Has anyone 
ever tried running this code through an actual profiler?

Perhaps we do have to revert to doing what the library should be doing for us 
(long live proper functional programming and async programming, and soon may it 
come to our corner of java). While we're at it, should we look at an async 
logger on the backend?

> Add defensive log level checks when constructing logs is expensive
> ------------------------------------------------------------------
>
>                 Key: METRON-2195
>                 URL: https://issues.apache.org/jira/browse/METRON-2195
>             Project: Metron
>          Issue Type: Improvement
>            Reporter: Otto Fowler
>            Priority: Critical
>
> There are instances where we log, and output strings for json objects and 
> other things that are quite expensive.
> These are done regardless of the log level being enabled and can increase 
> performance significantly:
> https://gist.github.com/mmiklavc/7fd6af13bfa0ca05d9b3f4e7806c8d77
> https://github.com/apache/metron/blob/master/metron-platform/metron-writer/metron-writer-storm/src/main/java/org/apache/metron/writer/hdfs/HdfsWriter.java#L127
> We need to find places where this happens, and employ the best practice check 
> for the log level being enabled ( best practice if your parameters or log 
> message construction takes a lot of time ).



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

Reply via email to