From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 67239 invoked by alias); 10 Apr 2016 19:54:43 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 67227 invoked by uid 89); 10 Apr 2016 19:54:43 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=H*RU:!192.168.1.9!, H*r:ip*192.168.1.9, Hx-spam-relays-external:!192.168.1.9!, Faster X-HELO: zimbra.cs.ucla.edu Subject: Re: Faster string to integer conversion To: Faissal Bensefia , libc-alpha@sourceware.org References: <570A225E.20409@me.com> From: Paul Eggert Message-ID: <570AAF76.6090007@cs.ucla.edu> Date: Sun, 10 Apr 2016 19:54:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <570A225E.20409@me.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2016-04/txt/msg00175.txt.bz2 Thanks for thinking about this. Certainly strtol etc. could be sped up and the approach you mention might be a win; it's hard to say, given its setup overhead. In practice most integers are small, and you'd need to benchmark the approach on a set of integers that are of "typical" size. It may well be more work to come up with a convincing benchmark than to come up with the actual code. If you're interested in strtol speedup ideas, how about this one? Jettison tables like __strtol_ul_max_tab and replace their uses with invocations of the INT_ADD_WRAPV macro defined by the following recently-proposed patch: https://sourceware.org/ml/libc-alpha/2016-04/msg00174.html