[jira] [Commented] (LOG4NET-429) Pattern with Context property causes severe slowdown
[ https://issues.apache.org/jira/browse/LOG4NET-429?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14017739#comment-14017739 ] Dominik Psenner commented on LOG4NET-429: - As far as I can recall, every composite dictionary was flattened at some point when I wrote my patch. Pattern with Context property causes severe slowdown Key: LOG4NET-429 URL: https://issues.apache.org/jira/browse/LOG4NET-429 Project: Log4net Issue Type: Improvement Components: Core Affects Versions: 1.2.13 Reporter: Jonas Versén Assignee: Dominik Psenner Priority: Minor Labels: performance Attachments: LOG4NET-429-alternative.patch, LOG4NET-429.patch If you use a context property in your appenders pattern, there will be a significant logging slowdown. In my experience anywhere from 3 to 5 times slower (this will depend on the appender). I believe that as soon as you use a context property log4net will internally access the windows user name even though it's not the property you want to access. This theory comes from the fact that printing all properties in the pattern (including the costly property username) compared to just printing one will slow down the logging with the same factor. I've made a stackoverflow question with more details as well http://stackoverflow.com/questions/22612286/using-log4net-context-properties-has-negative-impact-on-performance/ -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (LOG4NET-429) Pattern with Context property causes severe slowdown
[ https://issues.apache.org/jira/browse/LOG4NET-429?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14017765#comment-14017765 ] Stefan Bodewig commented on LOG4NET-429: Hmm. in that case any patch that tried to generalize laziness would become pretty convoluted. Let's stick with your original patch. Pattern with Context property causes severe slowdown Key: LOG4NET-429 URL: https://issues.apache.org/jira/browse/LOG4NET-429 Project: Log4net Issue Type: Improvement Components: Core Affects Versions: 1.2.13 Reporter: Jonas Versén Assignee: Dominik Psenner Priority: Minor Labels: performance Attachments: LOG4NET-429-alternative.patch, LOG4NET-429.patch If you use a context property in your appenders pattern, there will be a significant logging slowdown. In my experience anywhere from 3 to 5 times slower (this will depend on the appender). I believe that as soon as you use a context property log4net will internally access the windows user name even though it's not the property you want to access. This theory comes from the fact that printing all properties in the pattern (including the costly property username) compared to just printing one will slow down the logging with the same factor. I've made a stackoverflow question with more details as well http://stackoverflow.com/questions/22612286/using-log4net-context-properties-has-negative-impact-on-performance/ -- This message was sent by Atlassian JIRA (v6.2#6252)