Adding a '-D date' option to `cat'

Peter Jeremy peterjeremy at optushome.com.au
Tue Sep 5 02:08:32 PDT 2006


On Tue, 2006-Sep-05 10:40:43 +0300, Giorgos Keramidas wrote:
>On 2006-09-05 03:28, Garance A Drosehn <gad at freebsd.org> wrote:
>> I intend to commit this within a few days, unless there are major
>> objections to it.  I am posting this HEADSUP under a new subject,
>> so people can dump all kinds of paint over me before I commit it.
>
>If you really plan to commit this, please consider Julian's original
>approach of comparing the gettimeofday() results with previous runs and
>re-using previous output of strftime(), since the latter is probably a
>quite 'expensive' operation.

strftime(3) is relatively cheap (similar to non-FP printf formats).
localtime(3) _is_ relatively expensive though, so this is a good idea.
This is also a trivial change because the strftime() output is already
effectively cached so it's just a matter of caching the time(3) result
and comparing.

(strptime(3) is a very expensive operation but we don't need it).
-- 
Peter Jeremy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-current/attachments/20060905/89832d37/attachment.pgp


More information about the freebsd-current mailing list