apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Pane <bp...@pacbell.net>
Subject Re: [PATCH] speed up network timeout processing
Date Sat, 06 Jul 2002 03:19:47 GMT
rbb@apache.org 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_poll() itself takes one more argument.  The types however are now
>complete, and apr_poll can be used on both files and sockets (as well as
>anything else we want to add).
>

I really like the basic design concept for this.  It provides a
good abstraction that would allow us to plug in /dev/poll in the
future if needed.

A couple of suggestions on the details:

* Instead of having apr_poll_setup just create an array of poll
  objects, it may be more flexible to have it create a wrapper object
  that contains the array.  (Just in case we need to add anything else
  to it in the future, like a file handle for /dev/poll.)

* The apr_poll_socket_add function looks like it's O(n).  That could be
  a problem if we ever need to poll a large number of descriptors (like
  in an event-loop server).  Adding a faster lookup would make the data
  structure more complicated, though.  Maybe it's best to just stick
  with the O(n) array approach for now, but encapsulate the data structures
  so that we can swap in a new design later if needed?

--Brian



Mime
View raw message