Marc,
Correct me if I am wrong: 1) Location information is extracted because you (or code in a software component you are using) have configured a layout which outputs location information. Simply stop using location information which is know to be slow. 2) The speed for the extraction of location information depends on the OS. It is known to be slow on AIX and other Unixes but quite fast on Windows which suggests that the problem is with the OS and not log4j. More comments later, ps: If you intend to respond, please do so on the log4j-dev@ mailing list. At 13:14 22.08.2002 -0700, Mark Womack wrote: >I am forwarding to the dev list so we will not forget about this. Ceki is >on vacation right now and I don't have time right this second. Anyone else? > >thanks, >-Mark > >-----Original Message----- >From: Marc Prud'hommeaux [mailto:[EMAIL PROTECTED]] >Sent: Thursday, August 22, 2002 11:57 AM >To: [EMAIL PROTECTED] >Subject: Slowness in LocationInfo construction > > > >I am using log4j-1.2.6.jar, and I am seeing that >org.apache.log4j.spi.LoggingEvent.getLocationInformation is taking up >73% of my CPU time. This is very distressing, since the CategoryLogger >is the default logger for the Apache Commons Logging project to use, so >just calling org.apache.commons.logging.LogFactory.getLog ("foo").log >("bar") >is going to show this performance hit. This is especially bad, since the >logging output does not even wind up using information from the >LocationInformation that takes so much time to create! > >The CPU usage from OptimizeIt is as follows, after which I suggest a >few performance improvements: > > Description of CPU usage for thread group main > 73.58% - 427461.0 ms - java.lang.Throwable.printStackTrace() > 73.58% - 427461.0 ms - >org.apache.log4j.spi.LocationInfo.<init>() > 73.58% - 427461.0 ms - >org.apache.log4j.spi.LoggingEvent.getLocationInformation() > 73.58% - 427461.0 ms - >org.apache.log4j.helpers.PatternParser$LocationPatternConverter.convert() > 73.58% - 427461.0 ms - >org.apache.log4j.helpers.PatternConverter.format() > 73.58% - 427461.0 ms - >org.apache.log4j.PatternLayout.format() > 73.58% - 427461.0 ms - >org.apache.log4j.WriterAppender.subAppend() > 73.58% - 427461.0 ms - >org.apache.log4j.WriterAppender.append() > 73.58% - 427461.0 ms - >org.apache.log4j.AppenderSkeleton.doAppend() > 73.58% - 427461.0 ms - >org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders() > 73.58% - 427461.0 ms - >org.apache.log4j.Category.callAppenders() > 73.58% - 427461.0 ms - >org.apache.log4j.Category.forcedLog() > 73.58% - 427461.0 >ms - org.apache.log4j.Category.log() > 73.58% - >427461.0 ms - org.apache.commons.logging.impl.Log4JCategoryLog.info() > 73.58% - >427461.0 ms - com.solarmetric.datasource.DataSourceImpl.log() -- Ceki -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>