Re: [patch v2] epoll use a single inode ...

H. Peter Anvin
2007-03-06T17:27:56Z

Linus Torvalds wrote:
>
> On Tue, 6 Mar 2007, Eric Dumazet wrote:
>> Something like :
>>
>> [PATCH] : Use reciprocal divides in sprintf()
>
> Try this on Core 2, and I suspect that you'll find that the hardware is
> actually *faster* than doing the shift/test, function call and the
> two multiplies.
>
>> Using reciprocal divides permits to change each divide by two multiplies, less
>> expensive on current CPUS.
>
> Are you sure?
>

For base 8 and 16, this is shift and mask, respectively, so it's bound
to be faster (although modern hardware can often optimize this, embedded
hardware definitely can't.) Base 10, which even in the Linux kernel is
almost certainly the most common case, is a lot iffier.

-hpa