tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Thomas <ma...@apache.org>
Subject Re: getCurrentTimeMillis definition in JDBCAccessValve
Date Mon, 02 Aug 2010 22:46:05 GMT
On 02/08/2010 23:33, Caldarale, Charles R wrote:
>> From: Mark Thomas [mailto:markt@apache.org]
>> Subject: Re: getCurrentTimeMillis definition in JDBCAccessValve
>>
>> Speed. This way we only generate a new date string every 1s.
> 
> But why generate the Date instance at all?  Since System.currentTimeMillis() is being
called every time, why not return that value, rather than ever creating a Date object with
a specific time just to return the time value it was constructed with?  The Date object itself
is not used outside the scope of this one method.

You no the mantra by now. If you can see room for improvement, patches
are always welcome. ;)

Note that there are some tests in the test tree you can use to see what
impact your changes have on performance.

Mark



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message