apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Pane <bri...@apache.org>
Subject Re: [PATCH] possible optimization in apr_poll()?
Date Mon, 15 Jul 2002 04:42:53 GMT
Ryan Bloom wrote:

>This will work, and should be portable.  Just a question, how big a
>performance improvement is this?  Have we hit the point where we are
>optimizing code just to optimize code?
>

Based on the profile data, 64-bit divisions *are* a problem,
but I think there's a better solution for this one...

>I would not support this change, simply because I don't see it making a
>huge difference.  We are better off fixing the apr_time_t implementation
>and then looking for things like this.
>

I agree.  Once we go to the binary microsecond implementation,
what we'll be able to do within poll is:
  - extract the microseconds with a bitwise AND (encapsulated within
    apr_time_usec())
  - cast to 32 bits if the macro doesn't do so automatically
  - then do a 32-bit division by 1000 to get milliseconds (which
    is a lot cheaper than the current 64-bit division on 32-bit
    platforms)

--Brian



Mime
View raw message