httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Orton <jor...@redhat.com>
Subject Re: svn commit: r109866 - /httpd/httpd/trunk/modules/loggers/mod_log_config.c
Date Sun, 05 Dec 2004 21:50:43 GMT
On Sun, Dec 05, 2004 at 01:58:44PM -0700, Paul Querna wrote:
> Joe Orton wrote:
> >On Sun, Dec 05, 2004 at 07:05:23AM -0000, Paul Querna wrote:
> >
> >>Author: pquerna
> >>Date: Sat Dec  4 23:05:23 2004
> >>New Revision: 109866
> >>
> >>URL: http://svn.apache.org/viewcvs?view=rev&rev=109866
> >>Log:
> >>mod_log_config.c: Use iovecs to write the log line to eliminate a memcpy
> >
> >
> >IIRC, writev'ing several small blocks to a file is actually generally
> >more expensive than doing a memcpy in userspace and calling write.  Did
> >you benchmark this to be faster/better/...?
> >

also that introduced a warning:

mod_log_config.c: In function `ap_default_log_writer':
mod_log_config.c:1353: warning: assignment discards qualifiers from pointer target type

> I did a local mini-benchmark of write w/ memcpy vs writev... and they 
> came out to almost exactly the same on average with small sets of data.

I remember I checked this before too... try the attached compiled with
or without -DUSE_WRITEV, copy-and-write comes out about ~10-20% faster
than writev on Linux 2.6/ext3 here for a real log vector, or did I screw
up the benchmark?

rm -f writev.out; sync; sleep 5
./writev-copy
copy+write: 7s330676.
rm -f writev.out; sync; sleep 5
./writev-copy
copy+write: 7s327580.
rm -f writev.out; sync; sleep 5
./writev-copy
copy+write: 7s360685.
rm -f writev.out; sync; sleep 5
./writev-writev
writev: 8s893524.
rm -f writev.out; sync; sleep 5
./writev-writev
writev: 8s808458.
rm -f writev.out; sync; sleep 5
./writev-writev
writev: 9s052335.

joe

Mime
View raw message