summaryrefslogtreecommitdiff
path: root/perl.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 /perl.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 'perl.c')
-rw-r--r--perl.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/perl.c b/perl.c
index b5ed17a866..a93c9200ae 100644
--- a/perl.c
+++ b/perl.c
@@ -272,6 +272,8 @@ perl_construct(pTHXx)
#endif
PL_clocktick = HZ;
+ PL_stashcache = newHV();
+
ENTER;
}
@@ -457,6 +459,9 @@ perl_destruct(pTHXx)
PL_regex_pad = NULL;
#endif
+ SvREFCNT_dec((SV*) PL_stashcache);
+ PL_stashcache = NULL;
+
/* loosen bonds of global variables */
if(PL_rsfp) {