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

Re: hash keys (Re: Ideas for papers)

Thread Previous | Thread Next
From:
Nicholas Clark
Date:
January 18, 2001 05:21
Subject:
Re: hash keys (Re: Ideas for papers)
Message ID:
20010118132128.G62349@plum.flirble.org
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? */
	    continue;

Patch 7106:

http://the.earth.li/~simon/cgi-bin/repository?filename=&action=patch&patch=7016&.submit=Submit+Query&.cgifields=action


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


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