httpd-test-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "MATHIHALLI,MADHUSUDAN (HP-Cupertino,ex1)" <madhusudan_mathiha...@hp.com>
Subject RE: gettimeofday calls
Date Fri, 24 Jan 2003 16:55:51 GMT
> -----Original Message-----
> From: Greg Ames [mailto:gregames@apache.org]

>I'm a little confused.  The gettimeofday()/apr_time_now() happens in the
httpd 
>core AFAIK.   Brian Pane said that it's cheaper than time() on some
platforms, I 
>believe.  If we want to discuss alternatives to that, the discussion
belongs on 
>dev@httpd

[sorry] That was a typo.. I was referring to the time(), and thinking of
alternative ways of replacing the time() call.

> OK, if you used r->request_time to replace the time() calls in
mod_specweb99, 
> you might have convert the units if the result gets sent as part of a
specweb 
> response or put in a file that will get sent to the client. If it's just
using 
> the values internally, like when it tries to avoid a stat(), there's no
need to 
> convert units as long as it always deals with the same units.
> 
> r->request_time is an apr_time_t (microseconds); time() gives you seconds 
> (time_t?).  There are some apr macros to do the conversions.

I did that (without using the macros) - but didn't see much difference
though.. I think I was banging my head against the wall yesterday - by tring
to remove something, but introducing something else complex :(.. 


> > Now, I have a global time variable, that I set once in
> > specweb99_quick_handler(), 
> 
> I think that would penalize the standard (no cookie/custom ad) dynamic 
> GETs...they shouldn't need any timestamp information at all.  
> Plus, I don't 
> understand why r->request_time wouldn't work for the custom ad path.

Infact, I tried this out yesterday (having the one global_time variable), it
gives me around 3-4% improvement. But, occasionally I do get some
un-conforming results, and I'm trying to figure out if it's because of the
time stamp.

Anyways, moving away from the time(), here's what I've been thinking..I'm
sure many of you have gone through this list, so, can you please give me
your feedback regarding the following :

1. Why we need to do the apr_stat() for static files each time the request
comes in - can it be done during the module_init() phase, and the values put
in a array of some sort. ?.
2. mmap the post.log, and since the post.log is requested only once, it can
be closed & re-mapped when the request comes in.

That would save us a couple of extra sys calls - any comments..

-Madhu

Mime
View raw message