[jira] [Updated] (LOG4NET-429) Pattern with Context property causes severe slowdown

2014-06-03 Thread Stefan Bodewig (JIRA)

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

Stefan Bodewig updated LOG4NET-429:
---

Attachment: LOG4NET-429-alternative.patch

This is an alternative patch which has arguably not been tested much.

Flatten is probably only called on CompositeProperties in situations where you 
really want to "fix" the UserName as well.

> 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] [Updated] (LOG4NET-429) Pattern with Context property causes severe slowdown

2014-03-25 Thread Dominik Psenner (JIRA)

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

Dominik Psenner updated LOG4NET-429:


Attachment: LOG4NET-429.patch

This is the patch that implements solution 3.

> 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.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)


AW: [jira] [Updated] (LOG4NET-429) Pattern with Context property causes severe slowdown

2014-03-25 Thread Dominik Psenner
Alright, I've hacked solution 3 into the CompositeProperties class and I'm 
attaching it to this mail for review. JIRA is unfortunately down for 
maintenance. :-( Let me know what you think about it.

Cheers


LOG4NET-429.patch
Description: Binary data


AW: [jira] [Updated] (LOG4NET-429) Pattern with Context property causes severe slowdown

2014-03-25 Thread Dominik Psenner
Hey people,

I've just noticed that my fix for LOG4NET-205 (rev 1511303) causes a severe 
performance impact whenever someone uses the %property PatternLayout. It is 
fact that my fix for LOG4NET-205 turned out to be a bad one. I have three ideas 
how we can solve this issue:

1] revert LOG4NET-205 and add a UserNameFilter and a IdentityFilter instead
2] add a global configuration flag that allows log4net to decide whether it 
should populate the UserName and the Identity into the event properties 
dictionary
3] hack the properties dictionary to treat the UserNameProperty and the 
IdentityProperty specially, allowing them to be looked up and cached only when 
they are requested

With 1 we solve the issue for good but we also drop a feature that has been 
introduced with 1.2.13 and thus we break backwards compatibilty. With 2 we 
allow people to work around the issue when they are concerned about performance 
but do not solve the issue for real. 3 is the best solution here, but 
introduces a dirty hack.

Does someone have a better idea? What solution would you prefer?

Cheers



[jira] [Updated] (LOG4NET-429) Pattern with Context property causes severe slowdown

2014-03-25 Thread Dominik Psenner (JIRA)

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

Dominik Psenner updated LOG4NET-429:


Component/s: (was: Appenders)
 Core
 Labels: performance  (was: )

> 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
>
> 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)