In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/9f53080ae514a42899f88743c9a5113d4677e9f6?hp=a4f1ca6eb9658c4d589c98787f06e1851909c7d5>
- Log ----------------------------------------------------------------- commit 9f53080ae514a42899f88743c9a5113d4677e9f6 Author: Father Chrysostomos <[email protected]> Date: Tue Oct 21 18:07:22 2014 -0700 sv.c: Always #define COW threshold constants They are also used in determining whether an operator target (PADTMP) should be swiped. If COW is not enabled, then the #if SV_COW_THRESHOLD ends up treating the threshold as 0, which means swiping almost always happens for tar- gets, resulting in an increase in malloc calls. So non-COW builds end up slower than they need to be. This also caused bug #123029 to occur more often under non-COW builds. ----------------------------------------------------------------------- Summary of changes: sv.c | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/sv.c b/sv.c index 8f46c19..9632b1a 100644 --- a/sv.c +++ b/sv.c @@ -48,25 +48,23 @@ PERL_UNUSED_RESULT(Gconvert((NV)(nv), (int)ndig, 0, buffer)) #endif -#ifdef PERL_NEW_COPY_ON_WRITE -# ifndef SV_COW_THRESHOLD +#ifndef SV_COW_THRESHOLD # define SV_COW_THRESHOLD 0 /* COW iff len > K */ -# endif -# ifndef SV_COWBUF_THRESHOLD +#endif +#ifndef SV_COWBUF_THRESHOLD # define SV_COWBUF_THRESHOLD 1250 /* COW iff len > K */ -# endif -# ifndef SV_COW_MAX_WASTE_THRESHOLD +#endif +#ifndef SV_COW_MAX_WASTE_THRESHOLD # define SV_COW_MAX_WASTE_THRESHOLD 80 /* COW iff (len - cur) < K */ -# endif -# ifndef SV_COWBUF_WASTE_THRESHOLD +#endif +#ifndef SV_COWBUF_WASTE_THRESHOLD # define SV_COWBUF_WASTE_THRESHOLD 80 /* COW iff (len - cur) < K */ -# endif -# ifndef SV_COW_MAX_WASTE_FACTOR_THRESHOLD +#endif +#ifndef SV_COW_MAX_WASTE_FACTOR_THRESHOLD # define SV_COW_MAX_WASTE_FACTOR_THRESHOLD 2 /* COW iff len < (cur * K) */ -# endif -# ifndef SV_COWBUF_WASTE_FACTOR_THRESHOLD +#endif +#ifndef SV_COWBUF_WASTE_FACTOR_THRESHOLD # define SV_COWBUF_WASTE_FACTOR_THRESHOLD 2 /* COW iff len < (cur * K) */ -# endif #endif /* Work around compiler warnings about unsigned >= THRESHOLD when thres- hold is 0. */ -- Perl5 Master Repository
