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

[patch] PL_stashcache doesn't work

Thread Next
Ruslan Zakirov
September 24, 2012 13:08
[patch] PL_stashcache doesn't work
Message ID:

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.

Best regards, Ruslan.

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About