You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Rustem Rafikov (JIRA)" <ji...@apache.org> on 2006/06/27 11:27:29 UTC

[jira] Created: (HARMONY-673) perf improving for util.logging.Logger

perf improving for util.logging.Logger
--------------------------------------

         Key: HARMONY-673
         URL: http://issues.apache.org/jira/browse/HARMONY-673
     Project: Harmony
        Type: Improvement

  Components: Classlib  
    Reporter: Rustem Rafikov
    Priority: Minor


I would like to suggest a patch improving performance of util.logging.Logger.

Summary of changes:
1. Frequently (on each logging call) used internalIsLoggable method became not synchronized and not  "walking" through parents if a logger should inherit a parent level. As setLevel occures much rarely than log call it is preferable to inherit a parent level when setting a parent and when changing a parent. internalIsLoggable uses int value of log level to avoid extra call to Level.intValue() method.
2. Main log method uses getHandlers returning array of handlers on each logging call. So, handlers.toArray(new Handler[0]) has been changed to handlers.toArray(new Handler[handlers.size()]) to avoid excessive creation of the array. It is much faster.


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (HARMONY-673) perf improving for util.logging.Logger

Posted by "Mikhail Loenko (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-673?page=comments#action_12418163 ] 

Mikhail Loenko commented on HARMONY-673:
----------------------------------------

Hi Rustem
do you have some tests showing performance improvements?
Thanks,
Mikhail

> perf improving for util.logging.Logger
> --------------------------------------
>
>          Key: HARMONY-673
>          URL: http://issues.apache.org/jira/browse/HARMONY-673
>      Project: Harmony
>         Type: Improvement

>   Components: Classlib
>     Reporter: Rustem Rafikov
>     Priority: Minor
>  Attachments: logging.patch
>
> I would like to suggest a patch improving performance of util.logging.Logger.
> Summary of changes:
> 1. Frequently (on each logging call) used internalIsLoggable method became not synchronized and not  "walking" through parents if a logger should inherit a parent level. As setLevel occures much rarely than log call it is preferable to inherit a parent level when setting a parent and when changing a parent. internalIsLoggable uses int value of log level to avoid extra call to Level.intValue() method.
> 2. Main log method uses getHandlers returning array of handlers on each logging call. So, handlers.toArray(new Handler[0]) has been changed to handlers.toArray(new Handler[handlers.size()]) to avoid excessive creation of the array. It is much faster.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Resolved: (HARMONY-673) perf improving for util.logging.Logger

Posted by "Mikhail Loenko (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-673?page=all ]
     
Mikhail Loenko resolved HARMONY-673:
------------------------------------

    Resolution: Fixed

integrated in revision 417718
thanks for the improvement!
Rustem, please check it was applied as expected

> perf improving for util.logging.Logger
> --------------------------------------
>
>          Key: HARMONY-673
>          URL: http://issues.apache.org/jira/browse/HARMONY-673
>      Project: Harmony
>         Type: Improvement

>   Components: Classlib
>     Reporter: Rustem Rafikov
>     Assignee: Mikhail Loenko
>     Priority: Minor
>  Attachments: LogPerfTest.java, logging.patch
>
> I would like to suggest a patch improving performance of util.logging.Logger.
> Summary of changes:
> 1. Frequently (on each logging call) used internalIsLoggable method became not synchronized and not  "walking" through parents if a logger should inherit a parent level. As setLevel occures much rarely than log call it is preferable to inherit a parent level when setting a parent and when changing a parent. internalIsLoggable uses int value of log level to avoid extra call to Level.intValue() method.
> 2. Main log method uses getHandlers returning array of handlers on each logging call. So, handlers.toArray(new Handler[0]) has been changed to handlers.toArray(new Handler[handlers.size()]) to avoid excessive creation of the array. It is much faster.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Assigned: (HARMONY-673) perf improving for util.logging.Logger

Posted by "Mikhail Loenko (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-673?page=all ]

Mikhail Loenko reassigned HARMONY-673:
--------------------------------------

    Assign To: Mikhail Loenko

> perf improving for util.logging.Logger
> --------------------------------------
>
>          Key: HARMONY-673
>          URL: http://issues.apache.org/jira/browse/HARMONY-673
>      Project: Harmony
>         Type: Improvement

>   Components: Classlib
>     Reporter: Rustem Rafikov
>     Assignee: Mikhail Loenko
>     Priority: Minor
>  Attachments: LogPerfTest.java, logging.patch
>
> I would like to suggest a patch improving performance of util.logging.Logger.
> Summary of changes:
> 1. Frequently (on each logging call) used internalIsLoggable method became not synchronized and not  "walking" through parents if a logger should inherit a parent level. As setLevel occures much rarely than log call it is preferable to inherit a parent level when setting a parent and when changing a parent. internalIsLoggable uses int value of log level to avoid extra call to Level.intValue() method.
> 2. Main log method uses getHandlers returning array of handlers on each logging call. So, handlers.toArray(new Handler[0]) has been changed to handlers.toArray(new Handler[handlers.size()]) to avoid excessive creation of the array. It is much faster.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (HARMONY-673) perf improving for util.logging.Logger

Posted by "Rustem Rafikov (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-673?page=all ]

Rustem Rafikov updated HARMONY-673:
-----------------------------------

    Attachment: LogPerfTest.java

Please run it as following:
<java_exe> LogPerfTest 10


> perf improving for util.logging.Logger
> --------------------------------------
>
>          Key: HARMONY-673
>          URL: http://issues.apache.org/jira/browse/HARMONY-673
>      Project: Harmony
>         Type: Improvement

>   Components: Classlib
>     Reporter: Rustem Rafikov
>     Priority: Minor
>  Attachments: LogPerfTest.java, logging.patch
>
> I would like to suggest a patch improving performance of util.logging.Logger.
> Summary of changes:
> 1. Frequently (on each logging call) used internalIsLoggable method became not synchronized and not  "walking" through parents if a logger should inherit a parent level. As setLevel occures much rarely than log call it is preferable to inherit a parent level when setting a parent and when changing a parent. internalIsLoggable uses int value of log level to avoid extra call to Level.intValue() method.
> 2. Main log method uses getHandlers returning array of handlers on each logging call. So, handlers.toArray(new Handler[0]) has been changed to handlers.toArray(new Handler[handlers.size()]) to avoid excessive creation of the array. It is much faster.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (HARMONY-673) perf improving for util.logging.Logger

Posted by "Rustem Rafikov (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-673?page=comments#action_12418192 ] 

Rustem Rafikov commented on HARMONY-673:
----------------------------------------

yes, 
1. With this patch I've got ~5% boost on SPECJbb2005 which activelly uses util.logging.
2. The attached file is microbenchmark which measures cost of logging call in the following cases: 
   - logging is ON, use parent is TRUE
   - logging is ON, use parent is FALSE
   - logging is OFF, use parent is TRUE
   - logging is OFF, use parent is FALSE
for example it shows improvement in ~3 times when logging is enabled and use-parent is set to FALSE; and ~70% when logging is disabled by setting Level.OFF to a logger.


> perf improving for util.logging.Logger
> --------------------------------------
>
>          Key: HARMONY-673
>          URL: http://issues.apache.org/jira/browse/HARMONY-673
>      Project: Harmony
>         Type: Improvement

>   Components: Classlib
>     Reporter: Rustem Rafikov
>     Priority: Minor
>  Attachments: logging.patch
>
> I would like to suggest a patch improving performance of util.logging.Logger.
> Summary of changes:
> 1. Frequently (on each logging call) used internalIsLoggable method became not synchronized and not  "walking" through parents if a logger should inherit a parent level. As setLevel occures much rarely than log call it is preferable to inherit a parent level when setting a parent and when changing a parent. internalIsLoggable uses int value of log level to avoid extra call to Level.intValue() method.
> 2. Main log method uses getHandlers returning array of handlers on each logging call. So, handlers.toArray(new Handler[0]) has been changed to handlers.toArray(new Handler[handlers.size()]) to avoid excessive creation of the array. It is much faster.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (HARMONY-673) perf improving for util.logging.Logger

Posted by "Rustem Rafikov (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-673?page=all ]

Rustem Rafikov updated HARMONY-673:
-----------------------------------

    Attachment: logging.patch

> perf improving for util.logging.Logger
> --------------------------------------
>
>          Key: HARMONY-673
>          URL: http://issues.apache.org/jira/browse/HARMONY-673
>      Project: Harmony
>         Type: Improvement

>   Components: Classlib
>     Reporter: Rustem Rafikov
>     Priority: Minor
>  Attachments: logging.patch
>
> I would like to suggest a patch improving performance of util.logging.Logger.
> Summary of changes:
> 1. Frequently (on each logging call) used internalIsLoggable method became not synchronized and not  "walking" through parents if a logger should inherit a parent level. As setLevel occures much rarely than log call it is preferable to inherit a parent level when setting a parent and when changing a parent. internalIsLoggable uses int value of log level to avoid extra call to Level.intValue() method.
> 2. Main log method uses getHandlers returning array of handlers on each logging call. So, handlers.toArray(new Handler[0]) has been changed to handlers.toArray(new Handler[handlers.size()]) to avoid excessive creation of the array. It is much faster.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Closed: (HARMONY-673) perf improving for util.logging.Logger

Posted by "Mikhail Loenko (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-673?page=all ]

Mikhail Loenko closed HARMONY-673.
----------------------------------


no complaints, assuming it's OK

> perf improving for util.logging.Logger
> --------------------------------------
>
>                 Key: HARMONY-673
>                 URL: http://issues.apache.org/jira/browse/HARMONY-673
>             Project: Harmony
>          Issue Type: Improvement
>          Components: Classlib
>            Reporter: Rustem Rafikov
>         Assigned To: Mikhail Loenko
>            Priority: Minor
>         Attachments: logging.patch, LogPerfTest.java
>
>
> I would like to suggest a patch improving performance of util.logging.Logger.
> Summary of changes:
> 1. Frequently (on each logging call) used internalIsLoggable method became not synchronized and not  "walking" through parents if a logger should inherit a parent level. As setLevel occures much rarely than log call it is preferable to inherit a parent level when setting a parent and when changing a parent. internalIsLoggable uses int value of log level to avoid extra call to Level.intValue() method.
> 2. Main log method uses getHandlers returning array of handlers on each logging call. So, handlers.toArray(new Handler[0]) has been changed to handlers.toArray(new Handler[handlers.size()]) to avoid excessive creation of the array. It is much faster.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira