Python compilers?

Peter Hansen peter at engcorp.com
Tue May 18 21:10:04 EDT 2004


SeeBelow at SeeBelow.Nut wrote:

> Leif K-Brooks wrote:
>>
>>What are you trying to achieve?
 >
> Yes, fast execution.  I have been using C.  In my applications there is
> a population of "chromosomes" which are arrays of floats, about 2 to 5 k
> in length.  Then there are subroutines which operate on a chromosome
> using pointers.  For example, the "crossover" routine uses two pointers
> to swap portions of two chromosomes.  My software sometimes runs for
> hours, perform many millions of operations like these.  Clearly, speed
> of execution is of dramatic importance.

The bottleneck is almost certainly in evaluating the fitness
function, not in performing the mutations and cross-overs.
What does your fitness function do with all those floats?
Perhaps it can be handled much faster with one of the numeric
extensions for Python...  or with Pyrex.

-Peter



More information about the Python-list mailing list