develooper Front page | perl.perl5.porters | Postings from January 2001

Re: hash keys (Re: Ideas for papers)

Thread Previous | Thread Next
Nicholas Clark
January 18, 2001 05:21
Re: hash keys (Re: Ideas for papers)
Message ID:
On Thu, Jan 18, 2001 at 12:33:56PM +0000, Nicholas Clark wrote:
> I can't see strcmp()s being avoided with SvPVX comparison - where should
> I be looking?

Sorry. Missed it because it's memNE:

	if (HeKEY(entry) != str && memNE(HeKEY(entry),str,len))	/* is this it? */

Patch 7106:

I was more wondering if there was a lazy way to avoid pre-calculating hash
keys for all strings, but instead to cache them only if it turned out
that they were needed (and caching was easy with no upgrade)

However, I'll try experimenting with whether the const PVIV in:

perl -MO=Terse -e '$foo{bar} = baz'
LISTOP (0x816cd18) leave
    OP (0x80fb338) enter
    COP (0x80fb2f8) nextstate
    BINOP (0x816ccf0) sassign
        SVOP (0x816ccd0) const  PV (0x80fc520) "baz"
        BINOP (0x81001a8) helem
            UNOP (0x8100648) rv2hv
                SVOP (0x8164640) gv  GV (0x80ff7e0) *foo
            SVOP (0x8100188) const  PVIV (0x80f5288) "bar"

should be a shared key string (and what speeds up and what slows down)
might be interesting. [first I have to work out how to do this...]

Nicholas Clark

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