Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 31 Oct 1999 14:50:49 -0800
From:      "David O'Brien" <obrien@NUXI.com>
To:        "Cc@FreeBSD.ORG"@FreeBSD.ORG:Dmitrij Tejblum <tejblum@arc.hq.cti.ru>, freebsd-arch@freebsd.org
Subject:   Re: stpcpy()
Message-ID:  <19991031145049.A90745@dragon.nuxi.com>
In-Reply-To: <Pine.BSF.4.10.9910311404140.11004-100000@alphplex.bde.org>; from bde@zeta.org.au on Sun, Oct 31, 1999 at 02:07:26PM %2B1100
References:  <199910302228.CAA03763@tejblum.pp.ru> <Pine.BSF.4.10.9910311404140.11004-100000@alphplex.bde.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Oct 31, 1999 at 02:07:26PM +1100, Bruce Evans wrote:
> > Good stpcpy() could double performance in some cases. You would touch a 
> > symbol once where you previously touched it twice.

> stpcpy() could halve performance in some cases (when the compiler inlines
> and combines strcpy() and strlen() but doesn't do anything special with
> stpcpy(), and inlining is good).

Bruce hit the nail right on the head -- people are making assumptions
with out know what their compiler is doing.

Also, strcpy() and strlen() could easily be highly optimized ASM routines
that together are still faster than a C stpcpy().


> >  It actually may matter in some text-processing applications.

Yes, BUT one should only use these non-standard functions AFTER they've
actually done some profiling and see where the program is REALLY spending
their time.

-- 
-- David    (obrien@NUXI.com)




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19991031145049.A90745>