develooper Front page | perl.perl5.porters | Postings from September 2012

[patch] PL_stashcache doesn't work

Thread Next
From:
Ruslan Zakirov
Date:
September 24, 2012 13:08
Subject:
[patch] PL_stashcache doesn't work
Message ID:
CAMOxC8tU04zHW-1MYKK3sKqB6D=oTG6iypt4MqnSEaneSFACXg@mail.gmail.com
Hi,

PL_stashcache is missing most of the time

On lookup via hv_common_key_len, length of key should be either
positive (not UTF8) or negative(UTF8), but because of a mistake
not UTF8 case was always resulted in zero lenght. Empty string
is perfectly valid hash key, so always resulted in cache miss.

So class method call (not object method calls) was penalized by
hash lookup for empty key in the cache, lookup of IO handle with the
same name, not cached lookup of a stash for the package and hash
store to save stash in the cache. Caching is still difficult :)

Instead of using hv_common_key_len we better use hv_common directly
as the former just converts negative keylen to HVhek_UTF8 flag and
calls the latter. We can do the same without loose in readability
or functionality.

https://github.com/ruz/perl5/commit/87151149e14dace1637e49c603a2622ce76b3b19

-- 
Best regards, Ruslan.

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About