There's been a bunch of discussion on this one... IMO:
-1 on changing apr_time_t's resolution (in some cases, we need usec)
+1 on OtherBill's (?) idea for apr_now_rough() to return second resolution.
Return type is apr_uint32_t.
Cheers,
-g
On Fri, Feb 23, 2001 at 02:50:34PM -0500, Bill Stoddard wrote:
> The essence of this patch is:
>
> apr_now() calls st_time() rather than a native system call
>
> st_time() returns time with one second resolution, which means it probably
> caches the time and updates the cache once per second. If the server serves
> 1000 cps, this saves 999 calls to determine the system time per second.
>
> The rest of the changes leverage the reduced resolution which makes possible
> simpler conversion/formatting functions and caching (of the string to go into
> the Date: header for instance) available to other time functions.
>
> This patch would need to be reimplemented to not rely on the state thread
> library and would need to be made portable to all platforms and MPMs.
>
> FWIW, I did this exact same thing with the IBM AFPA cache on NT several years
> back to handle Date: timestamps. A timer thread pops once per second to
> update the cached Date: string (among other things). I kept two copies of the
> string, a 'live' string and an 'update' string and ping-ponged between the two
> each timer pop which made locking during updates unnecessary. It was good for
> a few % performance boost :-)
>
> Bill
>...
--
Greg Stein, http://www.lyra.org/