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-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to