Date: Tue, 5 Sep 2006 19:08:29 +1000 From: Peter Jeremy <peterjeremy@optushome.com.au> To: Giorgos Keramidas <keramida@FreeBSD.org> Cc: freebsd-current@FreeBSD.org, Garance A Drosehn <gad@FreeBSD.org> Subject: Re: Adding a '-D date' option to `cat' Message-ID: <20060905090829.GC753@turion.vk2pj.dyndns.org> In-Reply-To: <20060905074043.GA87471@gothmog.pc> References: <200608281545.k7SFjn6l063922@lurza.secnetix.de> <p06230928c11e2298ca97@[128.113.24.47]> <200609020956.54008.Lucas.James@ldjcs.com.au> <20060902031247.GE749@turion.vk2pj.dyndns.org> <20060904192006.GA3292@turion.vk2pj.dyndns.org> <p06230937c122c6983e00@[128.113.24.47]> <20060905074043.GA87471@gothmog.pc>
next in thread | previous in thread | raw e-mail | index | archive | help
--ZJcv+A0YCCLh2VIg Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, 2006-Sep-05 10:40:43 +0300, Giorgos Keramidas wrote: >On 2006-09-05 03:28, Garance A Drosehn <gad@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). --=20 Peter Jeremy --ZJcv+A0YCCLh2VIg Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (FreeBSD) iD8DBQFE/T6N/opHv/APuIcRAgjCAJ4+bB2fHjVf8WE0tkL5Lfk+ZQFnnQCgrrUK 3tlg4ub0ZUAZAkBMPRE3Buo= =tm2W -----END PGP SIGNATURE----- --ZJcv+A0YCCLh2VIg--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060905090829.GC753>