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

2014-06-03 Thread Dominik Psenner (JIRA)

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

Dominik Psenner edited comment on LOG4NET-429 at 6/3/14 5:06 PM:
-

Re-reading my code now I would prefer that too. Feel free to patch the patch. 
:-)


was (Author: nachbarslumpi):
I would prefer that too. Feel free to patch the 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.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] [Comment Edited] (LOG4NET-429) Pattern with Context property causes severe slowdown

2014-06-01 Thread Stefan Bodewig (JIRA)

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

Stefan Bodewig edited comment on LOG4NET-429 at 6/1/14 6:00 PM:


I like the way you've lifted the code to SystemInfo

Personally I would probably add a new ReadOnlyPropertiesDictionary with the 
lazy loading semantics and add that to the m_compositeProperties instance 
rather than add the caching inside ComositeProperties but I haven't got any 
working code to show right now and your solution works just as well.


was (Author: bodewig):
I like the way you've moved lifted the code to SystemInfo

Personally I would probably add a new ReadOnlyPropertiesDictionary with the 
lazy loading semantics and add that to the m_compositeProperties instance 
rather than add the caching inside ComositeProperties but I haven't got any 
working code to show right now and your solution works just 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.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] [Comment Edited] (LOG4NET-429) Pattern with Context property causes severe slowdown

2014-03-25 Thread Stefan Bodewig (JIRA)

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

Stefan Bodewig edited comment on LOG4NET-429 at 3/25/14 1:09 PM:
-

This is LOG4NET-421 as well, right?  The reporter included a workaround that 
may help if this becomes an issue before we fix it.

Haven't looked at the patch, yet, but would aim for something like 3 myself.


was (Author: bodewig):
This is LOG4NET-421 as well, right?

Haven't looked at the patch, yet, but would aim for something like 3 myself.

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


[jira] [Comment Edited] (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:comment-tabpanel&focusedCommentId=13946453#comment-13946453
 ] 

Dominik Psenner edited comment on LOG4NET-429 at 3/25/14 12:31 PM:
---

So far I came up with 3 solutions and let's discuss about those:

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.11 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 will be the solution with no impact on 
the public API, but introduces a dirty hack.

>From my point of view we should aim towards solution 3 and thus I'm attaching 
>a working patch that suffers from the performance penalty only if somebody 
>effectively uses _%property\{log4net:UserName}_ in the pattern layout.


was (Author: nachbarslumpi):
So far I came up with 3 solutions and let's discuss about those:

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 will be the solution with no impact on 
the public API, but introduces a dirty hack.

>From my point of view we should aim towards solution 3 and thus I'm attaching 
>a working patch that suffers from the performance penalty only if somebody 
>effectively uses _%property\{log4net:UserName}_ in the pattern layout.

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


[jira] [Comment Edited] (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:comment-tabpanel&focusedCommentId=13946454#comment-13946454
 ] 

Dominik Psenner edited comment on LOG4NET-429 at 3/25/14 12:30 PM:
---

This is the patch that implements solution 3, discuss.


was (Author: nachbarslumpi):
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)