From owner-freebsd-arch Mon Nov 1 11:37:35 1999 Delivered-To: freebsd-arch@freebsd.org Received: from ns1.yes.no (ns1.yes.no [195.204.136.10]) by hub.freebsd.org (Postfix) with ESMTP id D13DC14C19 for ; Mon, 1 Nov 1999 11:37:31 -0800 (PST) (envelope-from eivind@bitbox.follo.net) Received: from bitbox.follo.net (bitbox.follo.net [195.204.143.218]) by ns1.yes.no (8.9.3/8.9.3) with ESMTP id UAA06724 for ; Mon, 1 Nov 1999 20:37:29 +0100 (CET) Received: (from eivind@localhost) by bitbox.follo.net (8.8.8/8.8.6) id UAA74681 for freebsd-arch@freebsd.org; Mon, 1 Nov 1999 20:37:29 +0100 (MET) Received: from smtp02.primenet.com (smtp02.primenet.com [206.165.6.132]) by hub.freebsd.org (Postfix) with ESMTP id 9F55914C19; Mon, 1 Nov 1999 11:36:25 -0800 (PST) (envelope-from tlambert@usr02.primenet.com) Received: (from daemon@localhost) by smtp02.primenet.com (8.8.8/8.8.8) id MAA02540; Mon, 1 Nov 1999 12:36:23 -0700 (MST) Received: from usr02.primenet.com(206.165.6.202) via SMTP by smtp02.primenet.com, id smtpd002498; Mon Nov 1 12:36:13 1999 Received: (from tlambert@localhost) by usr02.primenet.com (8.8.5/8.8.5) id MAA29291; Mon, 1 Nov 1999 12:36:13 -0700 (MST) From: Terry Lambert Message-Id: <199911011936.MAA29291@usr02.primenet.com> Subject: Re: stpcpy() To: obrien@freebsd.org Date: Mon, 1 Nov 1999 19:36:13 +0000 (GMT) Cc: rjesup@wgate.com, freebsd-arch@freebsd.org In-Reply-To: <19991029234654.B89583@dragon.nuxi.com> from "David O'Brien" at Oct 29, 99 11:46:55 pm X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > On Fri, Oct 29, 1999 at 03:58:14PM +0000, Randell Jesup wrote: > > stpcpy() (the issue in this case) is something I've seen in > > compiler's C libraries since the late 80's/early 90's (if I remember > > correctly), if I remember correctly. Quite honestly, it's useful > ... > > It's handy and improves performance for the cases where it's > > Why is it so useful and "improves" performance so much?? I'll only > believe this when I see some perf traces. Strings don't tend to be very > long ( < 256). Thus an c*O(n), where c = (2 + 1 function call) doesn't > sound like a big savings. Especially in the face of portability. > > I really think 99% of the programs using stpcpy() for "speed" reasons > would spend 99% of their time elsewhere if p=strchr(strcpy(d,s), '\0'); > were used. I believe the point is to iterate the string once, instead of twice, without having to learn how to use pointers yourself. Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message