[PEAK] speedups

Phillip J. Eby pje at telecommunity.com
Sun Jun 20 04:41:01 EDT 2004


At 08:07 PM 6/19/04 -0700, darryl wrote:
>Just curious how one takes advantage of the pyrex speedups in peak. Do 
>they get detected / installed automagically?

If you mean protocols._speedups, they're imported by the corresponding 
Python code.  E.g. in protocols.api:

     def adapt(...):
         ...

     try:
         from _speedups import adapt
     except ImportError:
         pass

If _speedups is present, this replaces the pure-Python 'adapt' with the C one.

_speedups is present if it's compiled/installed, which it will be if you 
have a C compiler and don't specify '--without-speedups' when installing 
PyProtocols.

PEAK, on the other hand, absolutely depends on having its C modules 
installed, since e.g. the 'binding' package won't work without it, and none 
of the rest of the PEAK core will work without the 'binding' package.  So, 
it's not a question of detection there: you *will* have the Pyrex modules 
or else.  :)




More information about the PEAK mailing list