From: Marcus Holland-Moritz Date: Fri, 15 Feb 2008 17:00:15 +0000 (+0100) Subject: Enable caching of strxfrm() results also for readonly SVs as X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=16ec96eb5a252a78470d4a52a2fa7fe6fa01f72e;p=p5sagit%2Fp5-mst-13.2.git Enable caching of strxfrm() results also for readonly SVs as returned e.g. by "keys %hash". This speeds up sorting of lots of hash keys significantly. See also: Subject: Slowdown of "sort keys %hash" under "use locale" Message-ID: <20080215170015.72f6160d@r2d2> p4raw-id: //depot/perl@33334 --- diff --git a/sv.c b/sv.c index 2aefe3e..3d60e02 100644 --- a/sv.c +++ b/sv.c @@ -6494,11 +6494,6 @@ Perl_sv_collxfrm(pTHX_ SV *sv, STRLEN *nxp) Safefree(mg->mg_ptr); s = SvPV_const(sv, len); if ((xf = mem_collxfrm(s, len, &xlen))) { - if (SvREADONLY(sv)) { - SAVEFREEPV(xf); - *nxp = xlen; - return xf + sizeof(PL_collation_ix); - } if (! mg) { #ifdef PERL_OLD_COPY_ON_WRITE if (SvIsCOW(sv))