You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "Emmanuel Lecharny (JIRA)" <ji...@apache.org> on 2006/06/24 16:20:30 UTC
[jira] Closed: (DIRMINA-193) Logger improvment
[ http://issues.apache.org/jira/browse/DIRMINA-193?page=all ]
Emmanuel Lecharny closed DIRMINA-193:
-------------------------------------
done
> 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