From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 48137 invoked by alias); 7 Oct 2015 15:30:06 -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 48115 invoked by uid 89); 7 Oct 2015 15:30:05 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.8 required=5.0 tests=AWL,BAYES_00,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx2.suse.de From: Andreas Schwab To: Joseph Myers Cc: , Wilco Dijkstra , GNU C Library Subject: Re: [PATCH] Use strlen when searching for a nul char References: <003a01d1010c$ad404240$07c0c6c0$@com> <5F638E7C-B8BD-4F94-8278-1F8B359CACCA@gmail.com> X-Yow: Don't worry, nobody really LISTENS to lectures in MOSCOW, either! .. FRENCH, HISTORY, ADVANCED CALCULUS, COMPUTER PROGRAMMING, BLACK STUDIES, SOCIOBIOLOGY!.. Are there any QUESTIONS?? Date: Wed, 07 Oct 2015 15:30:00 -0000 In-Reply-To: (Joseph Myers's message of "Wed, 7 Oct 2015 15:20:31 +0000") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2015-10/txt/msg00147.txt.bz2 Joseph Myers writes: > (And please accompany performance claims such as "faster on most targets" > with figures from the benchtests or a reason it's hard to produce such > figures. In this case I think the transformation could be justified for > GCC as something architecture-independent without specific performance > claims - strlen being inherently simpler because it only ever has to > search for 0 bytes, so it should never be asymptotically slower than the > alternative and may be faster.) On the debit side you have to keep the value of the pointer around in order to add it afterwards. Andreas. -- Andreas Schwab, SUSE Labs, schwab@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."