Re: [Python-Dev] LOAD_SELF and SELF_ATTR opcodes

2005-10-15 Thread Tim Delaney
Tim Delaney wrote: > that also binds all attribute accesses all the way down into a single > constant call e.g. > >LOAD_FAST 0 >LOAD_ATTR 'a' >LOAD_ATTR 'b' >LOAD_ATTR 'c' >LOAD_ATTR 'd' > > is bound to a single constant: > >LOAD_CONST 5 D'oh. I'm a moron - of course

Re: [Python-Dev] LOAD_SELF and SELF_ATTR opcodes

2005-10-15 Thread Phillip J. Eby
At 09:17 AM 10/15/2005 +0100, Michael Hudson wrote: >"Phillip J. Eby" <[EMAIL PROTECTED]> writes: > > > Indeed, even pystone doesn't do much attribute access on the first > argument > > of most of its functions, especially not those in inner loops. Only > > Proc1() and the Record.copy() method do

Re: [Python-Dev] LOAD_SELF and SELF_ATTR opcodes

2005-10-15 Thread Michael Hudson
"Phillip J. Eby" <[EMAIL PROTECTED]> writes: > Indeed, even pystone doesn't do much attribute access on the first argument > of most of its functions, especially not those in inner loops. Only > Proc1() and the Record.copy() method do anything that would be helped by > SELF_ATTR. But it seems

Re: [Python-Dev] LOAD_SELF and SELF_ATTR opcodes

2005-10-15 Thread Martin v. Löwis
[EMAIL PROTECTED] wrote: > (Send it to Raymond H. He'll probably sneak it in when Martin's not > looking. ) I'm not personally objecting :-) I just recall that there was that kind of objection when I proposed similar changes myself a couple of years ago. Regards, Martin _

Re: [Python-Dev] LOAD_SELF and SELF_ATTR opcodes

2005-10-14 Thread Tim Delaney
Sorry I can't reply to the message (I'm at home, and don't currently have python-dev sent there). I have a version of Raymond's constant binding recipe: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/277940 that also binds all attribute accesses all the way down into a single constant

Re: [Python-Dev] LOAD_SELF and SELF_ATTR opcodes

2005-10-14 Thread skip
>> Phillip J. Eby wrote: >> > Anyway, my main question is, do these sound like worthwhile >> > optimizations? >> >> In the past, I think the analysis was always "no". It adds an opcode, >> so increases the size of the switch, causing more pressure on the >> cache, with

Re: [Python-Dev] LOAD_SELF and SELF_ATTR opcodes

2005-10-14 Thread Phillip J. Eby
At 12:33 AM 10/15/2005 +0200, Martin v. Löwis wrote: >Phillip J. Eby wrote: > > Anyway, my main question is, do these sound like worthwhile > > optimizations? > >In the past, I think the analysis was always "no". It adds >an opcode, so increases the size of the switch, causing >more pressure on the

Re: [Python-Dev] LOAD_SELF and SELF_ATTR opcodes

2005-10-14 Thread Martin v. Löwis
Phillip J. Eby wrote: > Anyway, my main question is, do these sound like worthwhile > optimizations? In the past, I think the analysis was always "no". It adds an opcode, so increases the size of the switch, causing more pressure on the cache, with an overall questionable effect. As for measuri

Re: [Python-Dev] LOAD_SELF and SELF_ATTR opcodes

2005-10-14 Thread skip
Phillip> Indeed, even pystone doesn't do much attribute access on the Phillip> first argument of most of its functions, especially not those Phillip> in inner loops. Only Proc1() and the Record.copy() method do Phillip> anything that would be helped by SELF_ATTR. But it seems to

[Python-Dev] LOAD_SELF and SELF_ATTR opcodes

2005-10-14 Thread Phillip J. Eby
I ran across an interesting paper about some VM optimizations yesterday: http://www.object-arts.com/Papers/TheInterpreterIsDead.PDF One thing mentioned was that saving even one cycle in their 'PUSH_SELF' opcode improved interpreter performance by 5%. I thought that was pretty cool, and the