From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965363AbXCFR14 (ORCPT ); Tue, 6 Mar 2007 12:27:56 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S965371AbXCFR14 (ORCPT ); Tue, 6 Mar 2007 12:27:56 -0500 Received: from terminus.zytor.com ([192.83.249.54]:56878 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965363AbXCFR1z (ORCPT ); Tue, 6 Mar 2007 12:27:55 -0500 Message-ID: <45EDA478.6060605@zytor.com> Date: Tue, 06 Mar 2007 09:27:20 -0800 From: "H. Peter Anvin" User-Agent: Thunderbird 1.5.0.9 (X11/20070212) MIME-Version: 1.0 To: Linus Torvalds CC: Eric Dumazet , Davide Libenzi , Linux Kernel Mailing List , Andrew Morton Subject: Re: [patch v2] epoll use a single inode ... References: <45ED08A9.9050501@cosmosbay.com> <45ED96A6.3000704@zytor.com> <200703061812.28478.dada1@cosmosbay.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org 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