speed up a numpy code with huge array

Stefan Behnel stefan_ml at behnel.de
Wed May 26 02:14:21 EDT 2010


Alexzive, 25.05.2010 21:05:
> is there a way to improve the performance of the attached code ? it
> takes about 5 h on a dual-core (using only one core) when len(V)
> ~1MIL. V is an array which is supposed to store all the volumes of
> tetrahedral elements of a grid whose coord. are stored in NN (accessed
> trough the list of tetraelements -->  EL)

Consider using Cython for your algorithm. It has direct support for NumPy 
arrays and translates to fast C code.

Stefan




More information about the Python-list mailing list