Can you make this faster?

Andrea Griffini agriff at tin.it
Tue Jun 29 02:20:31 EDT 2004


On Mon, 28 Jun 2004 17:37:23 -0300, alejandro david weil
<aweil at mail.ru> wrote:

>It seems that no one has read my last post :-)

Newsfeeding isn't synchronous by itself. News reading is
even less deterministic :-)

...

>And, another improvment is add the 's' to the 
>slen array :-) and..:

Original version      1.640
My version            0.782
Improved with slen[]  0.687

What however I find depressing is thinking that in so
many places the python runtime is wasting time looking
for something I'd never do (like replacing "len" or "str").
And for a function like the one the OP posted looks like
we're talking about more than 50% of the time being spent
doing those pointless searches.

It's IMO true that python is "fast enough" for most
situations... but ... what if I get sued from the
association for the rights of CPUs ? :-)

I didn't check python sources, is there a timestamping
for namespaces making it possible to cache lookups ?
Was this tried and didn't pay off ?

Andrea

PS: Sorry if all this is hyper-naive...




More information about the Python-list mailing list