Return-Path: Mailing-List: contact cocoon-dev-help@xml.apache.org; run by ezmlm Delivered-To: mailing list cocoon-dev@xml.apache.org Received: (qmail 94035 invoked from network); 15 Feb 2001 21:22:40 -0000 Received: from clever.visp-europe.psi.com (212.222.105.4) by h31.sny.collab.net with SMTP; 15 Feb 2001 21:22:40 -0000 Received: from ip219.zurich31.pub-ip.ch.psi.net ([154.15.31.219] helo=pwr.ch) by clever.visp-europe.psi.com with esmtp (Exim 3.22 #1) id 14TVr0-0007Cl-00 for cocoon-dev@xml.apache.org; Thu, 15 Feb 2001 22:22:18 +0100 Received: (qmail 10264 invoked from network); 15 Feb 2001 21:09:03 -0000 Received: from lap1a.pwr.ch (HELO lap1) (giacomo@10.20.30.113) by simba.pwr.ch with SMTP; 15 Feb 2001 21:09:03 -0000 From: Giacomo Pati Organization: Apache Software Foundation Date: Thu, 15 Feb 2001 22:08:14 +0100 X-Mailer: KMail [version 1.1.99] Content-Type: text/plain; charset="us-ascii" To: cocoon-dev@xml.apache.org References: <3A8BEC74.8D935CF8@apache.org> In-Reply-To: <3A8BEC74.8D935CF8@apache.org> Subject: Re: log performance penalties MIME-Version: 1.0 Message-Id: <01021522081404.01499@lap1> Content-Transfer-Encoding: quoted-printable X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N Stefano Mazzocchi wrote: > I'm looking at the changes made to Cocoon while I was away: > > are you guys aware of the fact that something like > > getLogger().debug("Making URL from " + location); > > is translated by java compilers into > > StringBuffer sb =3D new StringBuffer("Making URL from "); > sb.append(location); > getLogger().debug(sb.toString()); > > which generates > > 1) a new stringbuffer object > 2) a new String > > even if debug log channel is disabled? > > Probably so, but just to make sure. I'm fully aware of that but it has helped alot finding bugs because C2 is= a=20 very distributed exeption throwing and eating beast :). Most of the loggi= ng=20 stuff come from Berin and I've found that it was easy to debug now. > The only way to do it well is by wrapping the whole call around a log > channel test such as > > if (getLogger().debugIsActive()) getLogger().debug("Making URL from " = + > location); I've thought of how to weaken that and your idea seems to be one solution= =2E=20 The radical solution I had was to pipe the code through a filter that=20 eliminates all the debug loggin stuff (but in fact this would be a loss) > > FYI, doing this in JServ 1.0 resulted in a 20% performance improvement. > > I understand that performance fine tuning is very low priority right no= w > (and rightly so!) but please, keep this in mind from start or profiling > will be a major pain in the ass later on.