Return-Path: Delivered-To: apmail-tomcat-dev-archive@www.apache.org Received: (qmail 59220 invoked from network); 17 Nov 2010 23:15:48 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 17 Nov 2010 23:15:48 -0000 Received: (qmail 40423 invoked by uid 500); 17 Nov 2010 23:16:19 -0000 Delivered-To: apmail-tomcat-dev-archive@tomcat.apache.org Received: (qmail 40365 invoked by uid 500); 17 Nov 2010 23:16:19 -0000 Mailing-List: contact dev-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Developers List" Delivered-To: mailing list dev@tomcat.apache.org Received: (qmail 40356 invoked by uid 99); 17 Nov 2010 23:16:19 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Nov 2010 23:16:19 +0000 X-ASF-Spam-Status: No, hits=4.6 required=10.0 tests=RCVD_IN_PSBL,RCVD_IN_RP_RNBL,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [193.252.22.190] (HELO smtp6.freeserve.com) (193.252.22.190) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Nov 2010 23:16:11 +0000 Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf3601.me.freeserve.com (SMTP Server) with ESMTP id C06F07000086 for ; Thu, 18 Nov 2010 00:15:49 +0100 (CET) Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf3601.me.freeserve.com (SMTP Server) with ESMTP id B12307003D89 for ; Thu, 18 Nov 2010 00:15:49 +0100 (CET) Received: from mail.homeinbox.net (unknown [91.109.133.165]) by mwinf3601.me.freeserve.com (SMTP Server) with ESMTP id 8CFFC7000086 for ; Thu, 18 Nov 2010 00:15:49 +0100 (CET) X-ME-UUID: 20101117231549577.8CFFC7000086@mwinf3601.me.freeserve.com Received: from localhost (localhost [127.0.0.1]) by mail.homeinbox.net (Postfix) with ESMTP id C02B0EAA093 for ; Wed, 17 Nov 2010 23:15:48 +0000 (GMT) X-Virus-Scanned: Debian amavisd-new at homeinbox.net Received: from mail.homeinbox.net ([127.0.0.1]) by localhost (mail.homeinbox.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id bmEpO9cwgWaO for ; Wed, 17 Nov 2010 23:15:44 +0000 (GMT) Received: from s2laptop.dev.local (s2laptop.dev.local [192.168.23.202]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.homeinbox.net (Postfix) with ESMTPSA id 25D6AEAA091 for ; Wed, 17 Nov 2010 23:15:44 +0000 (GMT) Message-ID: <4CE4621F.8070105@apache.org> Date: Wed, 17 Nov 2010 23:15:43 +0000 From: Mark Thomas User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-GB; rv:1.9.2.12) Gecko/20101027 Thunderbird/3.1.6 MIME-Version: 1.0 To: Tomcat Developers List Subject: Re: svn commit: r1036021 - /tomcat/trunk/test/org/apache/catalina/session/Benchmarks.java References: <20101117130520.91BBA23888E7@eris.apache.org> <4CE3DA1D.3030204@apache.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 17/11/2010 19:49, Konstantin Kolinko wrote: > My impression looking on the above cited code of StandardSession is > that all that arithmetics should be done inside the manager. > > Then the manager can be optimized how to store it. +1, although it is slightly complicated by the PersistentManager that can call Manager.remove() when the session hasn't expired. Also, I don't think this is a bottleneck we need to worry about too much right now. > E.g., unless someone calls getSessionAverageAliveTime() the value of > average = (int) (((average * (numExpired-1)) + timeAlive)/numExpired); > is not needed. I think it is due to the way the average is maintained. It needs to be updated on every expiration. I'll see if a better option emerges when I add the rate of creatation/destruction stats. > Also that call can be moved out of synchronized(this). I don't think so, given the way it is currently calculated. Again, I'll see if a better solution emerges when I add the other stats. Cheers, Mark --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org For additional commands, e-mail: dev-help@tomcat.apache.org