diff options
author | Vincent Pit <perl@profvince.com> | 2009-08-27 11:13:09 +0200 |
---|---|---|
committer | Vincent Pit <perl@profvince.com> | 2009-08-27 12:54:36 +0200 |
commit | 16fa5c119c4bda5c0396a5f81296bd1ccc128a9c (patch) | |
tree | ae140159521df8110da72f27f01bb505664cb83c /embed.h | |
parent | 04c9e624265a2bf3bdeecd0310e754b5ecc8bbeb (diff) | |
download | perl-16fa5c119c4bda5c0396a5f81296bd1ccc128a9c.tar.gz |
Speed up repeatcpy() by at least 40% for 1-char or numerous repeats
And don't make it receive the interpreter anymore.
For 1-char repeats, use memset(). Otherwise, use the old implementation up
to some (small) length, and then use memcpy() in a binary manner, based on
what we previously copied.
Note that we use memcpy() so both strings shouldn't overlap. The previous
implementation didn't allow this as well. This would be a good place to use
the restrict keyword from C99. I'm not sure if Configure has a probe for it.
Diffstat (limited to 'embed.h')
-rw-r--r-- | embed.h | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -3076,7 +3076,7 @@ #if defined(PERL_CORE) || defined(PERL_EXT) #define regprop(a,b,c) Perl_regprop(aTHX_ a,b,c) #endif -#define repeatcpy(a,b,c,d) Perl_repeatcpy(aTHX_ a,b,c,d) +#define repeatcpy Perl_repeatcpy #define rninstr Perl_rninstr #define rsignal(a,b) Perl_rsignal(aTHX_ a,b) #ifdef PERL_CORE |