summaryrefslogtreecommitdiff
path: root/hv.c
diff options
context:
space:
mode:
authorArtur Bergman <sky@nanisky.com>2003-04-02 13:41:14 +0000
committerArtur Bergman <sky@nanisky.com>2003-04-02 13:41:14 +0000
commit081fc587427bbceff63d5141014aee022b3f9dd6 (patch)
tree40ce68e8875794031a9a20550881c9896268eeea /hv.c
parent6ab58e4d47c419dca1df070f2fa15786b3285750 (diff)
downloadperl-081fc587427bbceff63d5141014aee022b3f9dd6.tar.gz
Add packname->stash cache before the check if a packname is a
filehandle or a package, it works because only packnames that have been resolved to stashes are added to the cache, and when a newIO is created we clean the cache. Results in roughly 1.8 speed increase for class->method() calls. p4raw-id: //depot/perl@19133
Diffstat (limited to 'hv.c')
-rw-r--r--hv.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/hv.c b/hv.c
index c798f1b01d..4300e363bb 100644
--- a/hv.c
+++ b/hv.c
@@ -1739,6 +1739,8 @@ Perl_hv_undef(pTHX_ HV *hv)
hfreeentries(hv);
Safefree(xhv->xhv_array /* HvARRAY(hv) */);
if (HvNAME(hv)) {
+ if(PL_stashcache)
+ hv_delete_ent(PL_stashcache, sv_2mortal(newSVpv(HvNAME(hv),0)), G_DISCARD, 0);
Safefree(HvNAME(hv));
HvNAME(hv) = 0;
}