[PATCH] speed up network timeout processing

2002-07-03 Thread Jeff Trawick
A little bird told me that FD_ZERO() burns lots of cycles in apr_wait_for_io_or_timeout(). It turns out that this is an easy conversion to poll(), which doesn't have such overhead in the interface. This works for me with some testing (timeouts on read and write work for me). --- /tmp/sendrecv.c

RE: [PATCH] speed up network timeout processing

2002-07-03 Thread Ryan Bloom
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > > A little bird told me that FD_ZERO() burns lots of cycles in > apr_wait_for_io_or_timeout(). It turns out that this is an easy > conversion to poll(), which doesn't have such overhead in the > interface. > > This works for me with some test

Re: [PATCH] speed up network timeout processing

2002-07-03 Thread Jeff Trawick
"Ryan Bloom" <[EMAIL PROTECTED]> writes: > > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > > > > A little bird told me that FD_ZERO() burns lots of cycles in > > apr_wait_for_io_or_timeout(). It turns out that this is an easy > > conversion to poll(), which doesn't have such overhead in th

RE: [PATCH] speed up network timeout processing

2002-07-03 Thread Ryan Bloom
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > > "Ryan Bloom" <[EMAIL PROTECTED]> writes: > > > > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > > > > > > A little bird told me that FD_ZERO() burns lots of cycles in > > > apr_wait_for_io_or_timeout(). It turns out that this is an eas

RE: [PATCH] speed up network timeout processing

2002-07-03 Thread Bill Stoddard
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > > > > A little bird told me that FD_ZERO() burns lots of cycles in > > apr_wait_for_io_or_timeout(). It turns out that this is an easy > > conversion to poll(), which doesn't have such overhead in the > > interface. > > > > This works for me

RE: [PATCH] speed up network timeout processing

2002-07-03 Thread Ryan Bloom
> From: Bill Stoddard [mailto:[EMAIL PROTECTED] > > > > > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > > > > > > A little bird told me that FD_ZERO() burns lots of cycles in > > > apr_wait_for_io_or_timeout(). It turns out that this is an easy > > > conversion to poll(), which doesn't hav

RE: [PATCH] speed up network timeout processing

2002-07-03 Thread Bill Stoddard
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > > > > "Ryan Bloom" <[EMAIL PROTECTED]> writes: > > > > > > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > > > > > > > > A little bird told me that FD_ZERO() burns lots of cycles in > > > > apr_wait_for_io_or_timeout(). It turns out that

RE: [PATCH] speed up network timeout processing

2002-07-03 Thread Bill Stoddard
> > From: Bill Stoddard [mailto:[EMAIL PROTECTED] > > > > > > > > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > > > > > > > > A little bird told me that FD_ZERO() burns lots of cycles in > > > > apr_wait_for_io_or_timeout(). It turns out that this is an easy > > > > conversion to poll(), wh

Re: [PATCH] speed up network timeout processing

2002-07-03 Thread Jeff Trawick
"Ryan Bloom" <[EMAIL PROTECTED]> writes: > > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > > > > "Ryan Bloom" <[EMAIL PROTECTED]> writes: > > > > > > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > > > > > > > > A little bird told me that FD_ZERO() burns lots of cycles in > > > > apr_w

RE: [PATCH] speed up network timeout processing

2002-07-03 Thread Ryan Bloom
> From: Bill Stoddard [mailto:[EMAIL PROTECTED] > > > > > From: Bill Stoddard [mailto:[EMAIL PROTECTED] > > > > > > > > > > > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > > > > > > > > > > A little bird told me that FD_ZERO() burns lots of cycles in > > > > > apr_wait_for_io_or_timeout().

RE: [PATCH] speed up network timeout processing

2002-07-03 Thread Ryan Bloom
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > > "Ryan Bloom" <[EMAIL PROTECTED]> writes: > > > > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > > > > > > "Ryan Bloom" <[EMAIL PROTECTED]> writes: > > > > > > > > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > > > > > > > > > > A l

Re: [PATCH] speed up network timeout processing

2002-07-03 Thread Brian Pane
Ryan Bloom wrote: From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] "Ryan Bloom" <[EMAIL PROTECTED]> writes: From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] "Ryan Bloom" <[EMAIL PROTECTED]> writes: From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] A little bird told

RE: [PATCH] speed up network timeout processing

2002-07-03 Thread Ryan Bloom
> From: Brian Pane [mailto:[EMAIL PROTECTED] > > Ryan Bloom wrote: > > >>From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > >> > >>"Ryan Bloom" <[EMAIL PROTECTED]> writes: > >> > >> > >> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > > "Ryan Bloom" <[EMAIL PROTECTED]> writes:

RE: [PATCH] speed up network timeout processing

2002-07-03 Thread Bill Stoddard
> Have either of you benchmarked with apr_poll() or are you assuming that > the problem exists? > > Ryan > > Sorry didn't answer you here... There definitely are extra instructions and function calls involved with using apr_poll() in this case. I don't know the exact number but I could find out.

RE: [PATCH] speed up network timeout processing

2002-07-03 Thread Sander Striker
> From: Brian Pane [mailto:[EMAIL PROTECTED] > Sent: 03 July 2002 18:05 >>You are missing the point. If apr_poll() is to be useful to external >>projects, then it must perform well. If it performs so poorly that we >>refuse to use it inside of APR, then it couldn't possibly be useful to >>extern

Re: [PATCH] speed up network timeout processing

2002-07-03 Thread Jeff Trawick
"Bill Stoddard" <[EMAIL PROTECTED]> writes: > > Have either of you benchmarked with apr_poll() or are you assuming that > > the problem exists? > > > > Ryan > > > > > > Sorry didn't answer you here... There definitely are extra instructions and > function calls involved with using apr_poll() in t

RE: [PATCH] speed up network timeout processing

2002-07-03 Thread Sander Striker
> From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] Behalf Of Jeff Trawick > Sent: 03 July 2002 21:16 > "Bill Stoddard" <[EMAIL PROTECTED]> writes: > > > > Have either of you benchmarked with apr_poll() or are you assuming that > > > the problem exists? > > > > > > Ryan > > > > > > > > > > Sor

Re: [PATCH] speed up network timeout processing

2002-07-04 Thread Ian Holsman
Bill Stoddard wrote: From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] I'd rather pay the maintenance overhead on this code. BTW, testing on AIX yields up to a 9% increase in throughput with this patch (serving 500 byte file out of mod_mem_cache). Huge win for a small change! Bill fantastic speed

RE: [PATCH] speed up network timeout processing

2002-07-04 Thread Bill Stoddard
> > On Wed, 3 Jul 2002, Ian Holsman wrote: > > > Bill Stoddard wrote: > > >>>From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > > > > > > > > > I'd rather pay the maintenance overhead on this code. BTW, > testing on AIX > > > yields up to a 9% increase in throughput with this patch > (serving 500

Re: [PATCH] speed up network timeout processing

2002-07-05 Thread Ian Holsman
[EMAIL PROTECTED] wrote: Here is the patch to use apr_poll instead of select. This is just being posted for completeness, not because I believe it will actually perform as well as the standard poll() implementation. Bill offered to benchmark it, so I am posting it. I will re-implement apr_poll()

Re: [PATCH] speed up network timeout processing

2002-07-05 Thread rbb
On Wed, 3 Jul 2002, Ian Holsman wrote: > Bill Stoddard wrote: > >>>From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > > > > > I'd rather pay the maintenance overhead on this code. BTW, testing on AIX > > yields up to a 9% increase in throughput with this patch (serving 500 byte > > file out of

Re: [PATCH] speed up network timeout processing

2002-07-05 Thread rbb
Here is the patch to use apr_poll instead of select. This is just being posted for completeness, not because I believe it will actually perform as well as the standard poll() implementation. Bill offered to benchmark it, so I am posting it. I will re-implement apr_poll() tomorrow to offer much

Re: [PATCH] speed up network timeout processing

2002-07-05 Thread rbb
On Fri, 5 Jul 2002, Ian Holsman wrote: > [EMAIL PROTECTED] wrote: > > Here is the patch to use apr_poll instead of select. This is just being > > posted for completeness, not because I believe it will actually perform as > > well as the standard poll() implementation. Bill offered to benchmark i

Re: [PATCH] speed up network timeout processing

2002-07-06 Thread Roy T. Fielding
If that was all we were doing, I would agree with you. But `Jeff's patch implements BOTH select and poll with an #ifdef, because not every platform has poll(). This is exactly the reason for having apr_poll(), and not using it is stupid. If the argument is performance, then back it up with numbe

Re: [PATCH] speed up network timeout processing

2002-07-06 Thread rbb
On Fri, 5 Jul 2002, Roy T. Fielding wrote: > > If that was all we were doing, I would agree with you. But `Jeff's patch > > implements BOTH select and poll with an #ifdef, because not every platform > > has poll(). This is exactly the reason for having apr_poll(), and not > > using it is stupid.

Re: [PATCH] speed up network timeout processing

2002-07-06 Thread rbb
As promised, a new implementation of apr_poll, which should improve performance. I have only implemented the HAVE_POLL case so far, but the API is 99% the same, so I have no fear that the others are not possible. In fact, the ONLY change to the function API, is that apr_poll() itself takes one m

Re: [PATCH] speed up network timeout processing

2002-07-06 Thread rbb
Oh, one more advantage to this code, is that most of the apr_poll() support functions can either go away, or they can be merged to a common implementation. The only function that won't be common is apr_poll() itself. Ryan

Re: [PATCH] speed up network timeout processing

2002-07-06 Thread Brian Pane
[EMAIL PROTECTED] wrote: As promised, a new implementation of apr_poll, which should improve performance. I have only implemented the HAVE_POLL case so far, but the API is 99% the same, so I have no fear that the others are not possible. In fact, the ONLY change to the function API, is that apr_p

RE: [PATCH] speed up network timeout processing

2002-07-06 Thread Ryan Bloom
> From: Brian Pane [mailto:[EMAIL PROTECTED] > > [EMAIL PROTECTED] wrote: > > >As promised, a new implementation of apr_poll, which should improve > >performance. I have only implemented the HAVE_POLL case so far, but the > >API is 99% the same, so I have no fear that the others are not > >possib

New apr_poll() implementation was Re: [PATCH] speed up network timeout processing

2002-07-06 Thread Justin Erenkrantz
On Fri, Jul 05, 2002 at 08:47:32PM -0400, [EMAIL PROTECTED] wrote: > This also creates a support library for APR, this is basically just a > series of functions that APR can use internally to get the job > done. Since wait_for_io_or_timeout was identical between files and > sockets, I have moved t

RE: New apr_poll() implementation was Re: [PATCH] speed up network timeout processing

2002-07-06 Thread Ryan Bloom
> From: Justin Erenkrantz [mailto:[EMAIL PROTECTED] > > On Fri, Jul 05, 2002 at 08:47:32PM -0400, [EMAIL PROTECTED] wrote: > > This also creates a support library for APR, this is basically just a > > series of functions that APR can use internally to get the job > > done. Since wait_for_io_or_ti

Re: New apr_poll() implementation was Re: [PATCH] speed up network timeout processing

2002-07-06 Thread Justin Erenkrantz
On Sat, Jul 06, 2002 at 08:32:18AM -0700, Ryan Bloom wrote: > Because if Apache can't get it right, then I am assuming that nobody > else can either. I had originally coded it to use *nsds just as you > describe below, and it didn't pass any tests, because throughout the > code people were passing

RE: New apr_poll() implementation was Re: [PATCH] speed up network timeout processing

2002-07-06 Thread Ryan Bloom
> From: Justin Erenkrantz [mailto:[EMAIL PROTECTED] > > On Sat, Jul 06, 2002 at 08:32:18AM -0700, Ryan Bloom wrote: > > Because if Apache can't get it right, then I am assuming that nobody > > else can either. I had originally coded it to use *nsds just as you > > describe below, and it didn't pa

Re: New apr_poll() implementation was Re: [PATCH] speed up network timeout processing

2002-07-06 Thread Justin Erenkrantz
On Sat, Jul 06, 2002 at 12:11:59PM -0700, Ryan Bloom wrote: > I vote to fix the API so that these kinds of mistakes can't happen in > the future. I made a lot of mistakes when I designed APR (even though > Manoj tried to convince me I was wrong). One of those mistakes is > having functions use a

RE: New apr_poll() implementation was Re: [PATCH] speed up network timeout processing

2002-07-06 Thread Ryan Bloom
> From: Justin Erenkrantz [mailto:[EMAIL PROTECTED] > > On Sat, Jul 06, 2002 at 12:11:59PM -0700, Ryan Bloom wrote: > > I vote to fix the API so that these kinds of mistakes can't happen in > > the future. I made a lot of mistakes when I designed APR (even though > > Manoj tried to convince me I

Re: New apr_poll() implementation was Re: [PATCH] speed up network timeout processing

2002-07-07 Thread Aaron Bannert
On Sat, Jul 06, 2002 at 12:11:59PM -0700, Ryan Bloom wrote: > I vote to fix the API so that these kinds of mistakes can't happen in > the future. +1, let's fix the API now. (I also strongly dislike input/output parameters.) -aaron

Re: New apr_poll() implementation was Re: [PATCH] speed up network timeout processing

2002-07-08 Thread William A. Rowe, Jr.
At 11:47 AM 7/7/2002, Aaron Bannert wrote: On Sat, Jul 06, 2002 at 12:11:59PM -0700, Ryan Bloom wrote: > I vote to fix the API so that these kinds of mistakes can't happen in > the future. +1, let's fix the API now. (I also strongly dislike input/output parameters.) Microsoft's Win32 API was built