From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mo-p00-ob.rzone.de (mo-p00-ob.rzone.de [81.169.146.161]) by krisdoz.my.domain (8.14.3/8.14.3) with ESMTP id oBALHU3t029828 for ; Fri, 10 Dec 2010 16:17:31 -0500 (EST) X-RZG-AUTH: :JiIXek6mfvEEUpFQdo7Fj1/zg48CFjWjQv0cW+St/nW/afgnrylriWNGMFgNH4A= X-RZG-CLASS-ID: mo00 Received: from britannica.bec.de (ip-109-42-33-136.web.vodafone.de [109.42.33.136]) by post.strato.de (cohen mo45) (RZmta 24.8) with (DHE-RSA-AES128-SHA encrypted) ESMTP id 6051bdmBAIiK1e for ; Fri, 10 Dec 2010 22:17:28 +0100 (MET) Received: by britannica.bec.de (sSMTP sendmail emulation); Fri, 10 Dec 2010 22:17:27 +0100 Date: Fri, 10 Dec 2010 22:17:27 +0100 From: Joerg Sonnenberger To: tech@mdocml.bsd.lv Subject: Re: roff.c question Message-ID: <20101210211727.GA30572@britannica.bec.de> Mail-Followup-To: tech@mdocml.bsd.lv References: <4CF77A2B.6020702@bsd.lv> <4CF79F45.6080105@bsd.lv> <20101202225019.GD12188@iris.usta.de> <20101203214929.GB28384@iris.usta.de> <4CFBAC80.1060004@bsd.lv> <20101208010527.GA25360@iris.usta.de> <4D01F5A4.8010300@bsd.lv> <20101210204513.GB18607@iris.usta.de> <20101210205203.GA30244@britannica.bec.de> <20101210211020.GC18607@iris.usta.de> X-Mailinglist: mdocml-tech Reply-To: tech@mdocml.bsd.lv MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20101210211020.GC18607@iris.usta.de> User-Agent: Mutt/1.5.20 (2009-06-14) On Fri, Dec 10, 2010 at 10:10:20PM +0100, Ingo Schwarze wrote: > Hi Joerg, > > Joerg Sonnenberger wrote on Fri, Dec 10, 2010 at 09:52:03PM +0100: > > On Fri, Dec 10, 2010 at 09:45:13PM +0100, Ingo Schwarze wrote: > > >> If we want to go into micro-optimization, we could do this: > >> > >> for (cp = *bufp + pos; *cp; cp++) { > >> if ('\\' != *cp) > >> continue; > > > ... or use a single strchr() call to start the search. > > Sure, that would be correct, and not even obfuscation. > > > For the typical case of medium long lines and no \, strchr > > can operate mostly on dwords... > > Here is our implementation of strchr(): If "our" you mean OpenBSD, it is not the version in libc on most platforms, which is in assembler. But yes, the OpenBSD version e.g. for i386 is pretty stupid. Joerg -- To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv