summaryrefslogtreecommitdiff
path: root/gv.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 /gv.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 'gv.c')
-rw-r--r--gv.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gv.c b/gv.c
index cf43ae3553..0bedea47f7 100644
--- a/gv.c
+++ b/gv.c
@@ -1121,6 +1121,9 @@ Perl_newIO(pTHX)
sv_upgrade((SV *)io,SVt_PVIO);
SvREFCNT(io) = 1;
SvOBJECT_on(io);
+ /* Clear the stashcache because a new IO could overrule a
+ package name */
+ hv_clear(PL_stashcache);
iogv = gv_fetchpv("FileHandle::", FALSE, SVt_PVHV);
/* unless exists($main::{FileHandle}) and defined(%main::FileHandle::) */
if (!(iogv && GvHV(iogv) && HvARRAY(GvHV(iogv))))