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.fnc | |
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.fnc')
-rw-r--r-- | embed.fnc | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -860,7 +860,7 @@ EXp |SV*|reg_qr_package|NN REGEXP * const rx : FIXME - why the E? Ep |void |regprop |NULLOK const regexp *prog|NN SV* sv|NN const regnode* o -Ap |void |repeatcpy |NN char* to|NN const char* from|I32 len|I32 count +Anp |void |repeatcpy |NN char* to|NN const char* from|I32 len|I32 count AnpP |char* |rninstr |NN const char* big|NN const char* bigend \ |NN const char* little|NN const char* lend Ap |Sighandler_t|rsignal |int i|Sighandler_t t |