[Pyrex] Re: [Psyco-devel] Dynamic arrays, Pyrex and Psyco

Simon Frost sdfrost at ucsd.edu
Tue Jun 10 19:48:29 CEST 2003


Dear Armin,

I tried this implementation; however, I was surprised to note that while 
this style gave better performance in standard Python (about a 2-fold 
speed-up), it didn't give any improvement over the other style when the 
code was Python accelerated. Do you have any idea why this would be the case?

Best
Simon

At 01:06 PM 6/10/2003 +0200, you wrote:
>Note that Psyco performs better if you write the loops in a more Pythonic
>style (which is an example of what I like to emphasis: given good tools it is
>in the *interest* of performance to write higher-level code) :
>
>def primes(kmax):
>   p = []
>   n = 2
>   while len(p) < kmax:
>     for p1 in p:
>       if n % p1 == 0:
>         break
>     else:
>       p.append(n)
>     n = n + 1
>   return p
>
>With Psyco, this only needs 80% of the time needed by your original example.
>Surely enough Pyrex is still faster.




Simon D.W. Frost, M.A., D.Phil.
Department of Pathology
University of California, San Diego
Antiviral Research Center
150 W. Washington St., Suite 100
San Diego, CA 92103
USA

Tel: +1 619 543 8080 x275
Fax: +1 619 298 0177
Email: sdfrost at ucsd.edu

The information transmitted in this e-mail is intended only for the
person(s) or entity to which it is addressed and may contain
CONFIDENTIAL and/or privileged material. Any review, re-transmission,
dissemination or other use of or taking of any action in reliance upon
this information by persons or entities other than the intended
recipient is prohibited. If you received this e-mail in error, please
contact the sender and delete/destroy the material/information from any
computer.








More information about the Pyrex mailing list