This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Make gv_stashpvn() use PL_stashcache
authorsyber <syber@crazypanda.ru>
Fri, 8 Aug 2014 15:03:03 +0000 (19:03 +0400)
committerSteffen Mueller <smueller@cpan.org>
Wed, 20 Aug 2014 07:12:01 +0000 (09:12 +0200)
commit4e7ebec5b38b722121a7df00ce087bb49f1c6d43
tree5a5e862f19b63fde37e97d0021bca0ce3262e504
parentf88f10f50706154dd7828ac8abe4a02f99a5e280
Make gv_stashpvn() use PL_stashcache

perl has a stash name lookup cache, which is currently just used for
looking up up class names in Some::Class->method calls. This means
that a lookup of the class name 'A::B::C' gets reduced from doing
several stash lookups (e.g. $::{'A::'}{'B::'}{'C::'}) to a single
cache lookup (e.g. $PL_stashcache{'A::B::C::'}, so to speak).

Make gv_stashpvn() use this cache too, which means that all package
name lookups benefit, not just class method calls. Among other things,
this also indirectly affects bless operations both from Perl (OP_BLESS)
and XS.
gv.c