From owner-freebsd-arch Fri Oct 29 23:47: 5 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 2450114F66 for ; Fri, 29 Oct 1999 23:47:02 -0700 (PDT) (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 IAA05003 for ; Sat, 30 Oct 1999 08:47:01 +0200 (CEST) Received: (from eivind@localhost) by bitbox.follo.net (8.8.8/8.8.6) id IAA45845 for freebsd-arch@freebsd.org; Sat, 30 Oct 1999 08:47:00 +0200 (MET DST) Received: from relay.nuxi.com (nuxi.cs.ucdavis.edu [169.237.7.38]) by hub.freebsd.org (Postfix) with ESMTP id 83E2814F66 for ; Fri, 29 Oct 1999 23:46:56 -0700 (PDT) (envelope-from obrien@NUXI.com) Received: from dragon.nuxi.com (root@d60-025.leach.ucdavis.edu [169.237.60.25]) by relay.nuxi.com (8.9.3/8.9.3) with ESMTP id XAA02533; Fri, 29 Oct 1999 23:46:55 -0700 (PDT) (envelope-from obrien@dragon.nuxi.com) Received: (from obrien@localhost) by dragon.nuxi.com (8.9.3/8.9.1) id XAA89642; Fri, 29 Oct 1999 23:46:55 -0700 (PDT) (envelope-from obrien) Date: Fri, 29 Oct 1999 23:46:55 -0700 From: "David O'Brien" To: Randell Jesup Cc: freebsd-arch@freebsd.org Subject: Re: stpcpy() Message-ID: <19991029234654.B89583@dragon.nuxi.com> Reply-To: obrien@freebsd.org References: <19991029132257.A535@holly.calldei.com> <19991029111352.A87934@dragon.nuxi.com> <19991029132257.A535@holly.calldei.com> <199910291829.MAA89401@harmony.village.org> <19991029134549.B535@holly.calldei.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: ; from rjesup@wgate.com on Fri, Oct 29, 1999 at 03:58:14PM +0000 X-Operating-System: FreeBSD 4.0-CURRENT Organization: The NUXI BSD group X-PGP-Fingerprint: B7 4D 3E E9 11 39 5F A3 90 76 5D 69 58 D9 98 7A X-Pgp-Keyid: 34F9F9D5 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. -- -- David (obrien@NUXI.com) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message