You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "Trustin Lee (JIRA)" <ji...@apache.org> on 2006/03/21 06:38:02 UTC

[jira] Resolved: (DIRMINA-193) Logger improvment

     [ http://issues.apache.org/jira/browse/DIRMINA-193?page=all ]
     
Trustin Lee resolved DIRMINA-193:
---------------------------------

    Fix Version: 0.9.3
     Resolution: Fixed
      Assign To: Trustin Lee

I checked in the fix that doesn't create a message string when unnecessary.

WRT static loggers instead of getLogger(session), The category of the logger is not the class of the session but the class of the IoHandler.  IoHandler cannot be determined in compilation time unfortunately.  That's why we have to call getLogger() every time.

> Logger improvment
> -----------------
>
>          Key: DIRMINA-193
>          URL: http://issues.apache.org/jira/browse/DIRMINA-193
>      Project: Directory MINA
>         Type: Improvement
>     Reporter: Emmanuel Lecharny
>     Assignee: Trustin Lee
>     Priority: Minor
>      Fix For: 0.9.3

>
> The way SessionLog are used could be improved a little bit. The code looks like :
>     public void messageReceived( NextFilter nextFilter, IoSession session, Object message )
>     {
>         SessionLog.info( session, "RECEIVED: " + message );
>         ...
> and in SessionLog.info we have :
>     public static void info( IoSession session, String message )
>     {
>         Logger log = getLogger( session );
>         if( log.isInfoEnabled() )
>         {
>         ...
> The fact is that a String is created and appended with a other String for each invocation, and usually this is a waste of time, because we are not in info mode.
> A better solution could be to change two little things :
> - use a static logger instead of calling getLogger(session). It seems that we only have one single logger for all the sessions
> - check if we are in info mode before creating the message.
> I evaluate the gain to something around 2% speed improvment for the whole ADS, which is not neglictable (info deducted from a YourKit session)

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