Search
Primary links
Please donate to libfreevec to ensure its continuing development! Donations are done via Paypal.
strcpy()
markos — Tue, 29/01/2008 - 17:52
Description
According to the man page, the strcpy() function copies the string pointed to by src, including the terminating null byte ('\0'), to the buffer pointed to by dest. The strings may not overlap, and the destination string dest must be large enough to receive the copy. It returns a pointer to the destination string dest.
strcpy() is probably the #2 used string function (strlen() being the #1 string function), it's used basically everywhere, even if it has been accused of security problems (buffer overflows, etc). For that reason, it's optimised for almost every architecture, and of course, libfreevec provides an AltiVec-optimised version.
Each CPU in detail:
And for comparison here is the result of the same benchmark run on an Athlon X2 5000 (2.5Ghz), running 32-bit code:
Results/Comments
We're going to nag about the same bad performance in this function as we did for strcmp(). Seriously, the results we got from memcmp() and memcpy() suggest that the CPU is capable of much greater performance. While one might argue that this is not a glibc-bashing site, and we try to promote libfreevec instead of bashing glibc, on the other hand, it's a point that should be made and quite strongly, imho. There is little reason to buy powerful multicore systems running at insane frequencies if the software that will run on them is braindead.
Apart from that, we will also repeat the libmotovec's strange behaviour (good performance and steep performance drop afterwards).