moving items in a list

andy andy at eastonwest.co.uk
Fri Jan 10 17:59:19 EST 2003


Ok, ok.

Yes, of course I could time it, but that wouldn't tell me *why* it's x amount 
slower, which is what I'm driving at!

It's also very subjective:  Depends on cpu, memory bandwidth etc. etc.  Just 
because *my* pc says it's about 4% slower, yours might not.  BTW, a q'n'd 
test did say 4%.

I would assume that
a,b,c,d,e,f,g,h,i,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z=z,y,x,w,v,u,t,s,r,q,p,o,n,m,l,k,i,h,g,f,e,d,c,b,a
takes a lot longer...  but then, you'd simply have a lot more LOAD_FASTs, and 
accompanying STORE_FASTs sanwiching the CREATE_TUPLE, UNPACK_SEQUENCE pair.

You knew I meant in terms of efficiency :-p, didn't you!

regards,
-andyj






More information about the Python-list mailing list