> Vadim Gritsenko wrote:
>
> > -----Original Message-----
> > From: Carsten Ziegeler [mailto:[EMAIL PROTECTED]]
> > Sent: Tuesday, August 07, 2001 6:36 AM
> > To: Cocoon-Dev@Xml. Apache. Org
> > Subject: [C2]: Performance and logging
> >
> >
> > Hi,
> >
> > I know that we had this discussion some time ago, with no real solution,
> > so I thought: why not start it again?
> >
> > Looking at the way logging is performed in cocoon 2, I think this is
> > not very fast. Here an example:
> >
> > <CODE>
> >   getLogger().debug("Creating new Templates in " + this + " for " +
> > this.inputSource.getSystemId());
> > </CODE>
> >
> > Even if the priority debug is disabled, the method getLogger() (from
> > AbstractLoggable) is called returning the logger,
>
> IIRC, argument here was that getLogger() method is final and should
> be inlined by hotspot/JIT engine...
>
Yes, but looking through the LogKit website, there is the hint to
make the test itself and do not rely on this hotspot feature.
I find it very dangerous to rely on a special jvm implementation when
it comes to performance.

>
> > the expensive string concatenation is performed and the debug() method
> > of the logger is called. And these steps are done for every
> debug message!
> >
>
> Same thing here: if method is inlined, first is...enabled() check
> should occur.
> I'm not sure however that this occurs in reality.
>
> Carssten,
> Did you try to coment out all debug messages to check the difference in
> processing time?
>
No, I didn't have the time right now as there are some many log statements
and I think one should remove/change all when testing.
Did anyone else do this?

Carsten


>
> Vadim
>
> > We should change two things here:
> > a) Replace the getLogger() call with the use of an instance
> variable logger.
> >    This requires to make an own AbstractLoggable class which offers the
> > logger as an instance
> >    variable and not via a method.
> > b) Before logging testing the priority.
> >
> > So the example above should read:
> >
> > <CODE>
> >   if (this.logger.isDebugEnabled() == true) {
> >     this.logger.debug("Creating new Templates in " + this + " for " +
> > this.inputSource.getSystemId());
> >   }
> > </CODE>
> >
> > Comments? Ideas? Suggestions? Volunteers?
> >
> >
> > Carsten
> >
> > Open Source Group                        sunShine - b:Integrated
> > ================================================================
> > Carsten Ziegeler, S&N AG, Klingenderstrasse 5, D-33100 Paderborn
> > www.sundn.de                          mailto: [EMAIL PROTECTED]
> > ================================================================
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to